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

    val set = hashSetOf<Int>()
    a.forEach {
        set.add(it)
    }

    val a0 = a[0]
    val a1Candidats = mutableListOf<Int>()
    // Try to find a1
    a.forEach { a1 ->
        val a2 = a1 xor a0
        if (set.contains(a2)) {
            a1Candidats.add(a1)
        }
    }

    // Test
    val ans = IntArray(N)
    ans[0] = a0
    a1Candidats.forEach {a1 ->
        ans[1] = a1
        var ok = true
        (2..(N-1)).forEach {
            if (ok) {
                ans[it] = ans[it - 1] xor ans[it - 2]
                if (!set.contains(ans[it])) {
                    ok = false
                }
            }
        }

        if (ok) {
            if (ans[0] == ans[N-1] xor ans[N-2] && ans[1] == ans[0] xor ans[N -1]) {
                println("Yes")
                return
            }
        }
    }
    println("No")
}