fun main(args: Array<String>) {
    val n = readInputLine().toInt()
    val aList = readInputLine().split(" ").map { it.toInt() }.toList()
    val aSet = aList.toSet()
    
    if (n % 3 != 0) {
        println("No")
        return
    }

    if (aSet.size > 3) {
        println("No")
        return
    }
    
    if (aSet.size == 3) {
        var calcedXor = 0
        for (i in aSet) {
            if (aList.count {it == i} != n / 3) {
                println("No")
                return
            }
            calcedXor = calcedXor xor i 
        }
        if (calcedXor != 0) {
            println("No")
            return
        }
    }
    
    if (aSet.size == 2) {
        if (!aSet.contains(0)) {
            println("No")
            return
        }
        
        for (i in aSet) {
            if (i == 0) {
                continue
            }
            if (aList.count {it == i} != n * 2 / 3) {
                println("No")
                return
            }
        }
    }
    
    if (aSet.size == 1) {
        if (!aSet.contains(0)) {
            println("No")
            return
        }
    }

    println("Yes")
}

fun readInputLine(): String {
    return readLine()!!
}
