fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val a = readLine()!!.split(' ').map(String::toInt)
    if (n % 3 != 0) {
        if (a.all { it == 0 }) {
            println("Yes")
            return
        }
    } else {
        val po = a.groupBy { it }.map { Pair(it.key, it.value.size )}.sortedBy { it.second }
        if (po.size == 2) {
            if (po[0].second * 2 == po[1].second && po[0].first == 0) {
                println("Yes")
                return
            }
        } else if (po.size == 3) {
            if (po.groupBy { it.second }.size == 1 && po[0].first xor po[1].first == po[2].first) {
                println("Yes")
                return
            }
        }
    }
    println("No")
}
