import java.util.*
fun main(args: Array<String>) {
    val N  = nextInt()
    val A = listOfInt()
    val AS = HashSet<Int>(); AS.addAll(A)
    var ans = 0
    for (n in 0 until N) {
        for (m in 0 until N) {
            if (n == m) continue
            if ((A[n] xor A[m]) !in AS) continue
            ans++
            break
        }
    }
    if (ans >= N) println("Yes")
    else println("No")
}
fun next() = readLine()!!
fun nextInt() = Integer.parseInt(next())
fun listOfString() = next().split(" ")
fun listOfInt() = listOfString().map { Integer.parseInt(it) }
