import kotlin.system.exitProcess
import java.util.HashMap

fun main(args: Array<String>) {
    readLine()!!.toInt()
    val al = readLine()!!.split(" ").map { it.toInt() }

    val map = mutableMapOf<Int, Int>()
    al.forEach {
        val cur: Int? = map[it]
        if (cur != null) {
            map[it] = cur + 1
        } else {
            map[it] = 1
        }
    }

    val first = al.first()
    dd(pop(map, first), first, first)
    print("No")
}

fun pop(map: Map<Int, Int>, targetNum: Int): Map<Int, Int> {
    val clone = HashMap(map)
    val currentSize = clone[targetNum]!!
    if (currentSize == 1) {
        clone.remove(targetNum)
    } else {
        clone[targetNum] = currentSize - 1
    }
    return clone
}

fun dd(map: Map<Int, Int>, current: Int, first: Int) {
    if (map.size == 1) {
        if (current xor map.keys.first() == first) {
            print("Yes")
        } else {
            print("No")
        }
        exitProcess(0)
    }

    map.keys.forEach { test ->
        val next = current xor test
        if (map.containsKey(next)) {
            val nextMap = pop(map, test)
            dd(nextMap, test, first)
        }
    }
}
