n=int(input());l=list(map(int,input().split()))

from collections import Counter as co
var=co(l).items()

if n<=4:
    from itertools import permutations as pe
    for i in pe(l,r=None):
        #rは長さ、Noneでiteraterの長さ
        for i in range(n):
            if l[-1+i]^l[(i+1)%n]==l[i]:continue
            break
        else:print("Yes");exit()
    else:print("No");exit()
for i in l:
    hanten=~i&(pow(2,(len(bin(i))-2))-1)

    if hanten in var and var[hanten] and var[hanten]==var[hanten]:
        continue
    else:
        print("No");exit()
print("Yes")