import java.util.*
fun main(args: Array<String>){
	val cin = Scanner(System.`in`)
    val n = cin.nextInt()
    val a: MutableList<Int> = mutableListOf()

    for (i in 0..n-1) {
        a.add(cin.nextInt())
    }

    val a_s = a.sorted()
    var now = a_s[0]
    var ok = true
    var count0 = -1
    var val0 = -1
    var count1 = -1
    var val1 = -1
    
    var p = 0

    for (i in a_s) {
        if (i > now) {
            if (count1 >= 0) {
                ok = false
                break
            } else if (count0 >= 0) {
                count1 = p
                val1 = now
            } else {
                count0 = p
                val0 = now
            }
            now = i
        }
        p += 1
    }

    if (0 > count0) {
        count0 = n
    }
    if (0 > count1) {
        count1 = n - count0
    }
    
    if (!ok) {
        println("No")
    } else {
        val k = n / 3
        if (n % 3 == 0) {
            if (count0 % k != 0 || count1 % k != 0) {
                println("No")
            } else {
                if (a_s[k-1] xor a_s[2*k-1] == a_s[3*k-1]) {
                    println("Yes")
                } else {
                    println("No")
                }
            }
        } else if (n % 3 == 1) {
            if (a_s[n-1] == 0) {
                println("Yes")
            } else {
                println("No")
            }
        } else {
            if (a_s[k] == 0 && a_s[k+1] == a_s[n-1]) {
                println("Yes")
            } else {
                println("No")
            }
        }
    }
}