N = int(input())
a = list(map(int,input().split(" ")))
a_map = {}
for i in a:
    a_map[i] = 1
kouho = a[1:]
def findOne(chain,kouho):
    if len(kouho) == 0:
        return True
    last = chain
    for j in kouho:
        if last^j in a_map and a_map[(last^j)] == 1:
            a_map[j] = 2
            a_map[(last^j)] = 2
            ret = findOne(j,list(set(kouho)-set([j,last^j])))
            if ret:
                return True
            a_map[j] = 1
            a_map[(last^j)] = 1
    return False
a_map[a[0]] = 2
res = findOne(a[0],kouho)
if res:
    print("Yes")
else:
    print("No")