fun main(args: Array<String>) {
    agc035a()
}

fun agc035a() {
    val n = readLine()!!.toInt()
    val aList = readLine()!!.split(" ").map { it.toLong() }.toLongArray()

    val othersOfZero = aList.filterNot { it == 0L }
    val zeroCount =n-othersOfZero.size

    if (zeroCount == n) return println("Yes")

    if (n % 3 != 0) return println("No")

    if (n / 3 == zeroCount
        && othersOfZero.all { it == othersOfZero.first() }
    ) return println("Yes")
    
    if (othersOfZero.size!=n) return println("No")
    
    val grouped = othersOfZero.groupBy { it }
    
    if (grouped.size != 3 || grouped.map { it.value.size }.any { it!= n/3 }) return println("No")

    val xor = grouped.map { it.key }.reduce { acc, l -> acc xor l }
    
    return println( if (xor==0L) "Yes" else "No") 
}
