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

fun main(args: Array<String>) {
    readLine()
    val al = readLine()!!.split(" ").map { it.toInt() }
//    val al = listOf(1, 2, 3)

    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()
    for (i in 1 until al.size) {
        val next = al[i]
        dd(pop(map, first, next), first, next, first)
    }
    print("No")
}

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

fun dd(map: Map<Int, Int>, current: Int, next: Int, first: Int) {
//    println("dd==")
//    println("cur: $current")
//    println("nex: $next")
//    println("map: $map")

    if (map.size == 1) {
        if (current xor next == map.keys.first()) {
            print("Yes")
        } else {
            print("No")
        }
        exitProcess(0)
    }

    val dis = current xor next
    if (map.containsKey(dis)) {
        val nextMap = pop(map, next, dis)
        dd(nextMap, next, dis, first)
    }
}
