n=int(input())
a=[int(i) for i in input().split()]
a.sort()
if not all(a):
    print('Yes')
    exit()
if a.count(a[-1])==2*n/3 and a.count(0)==n/3:
    print('Yes')
    exit()
b=list(set(a))
k=len(b)
cnt=0
for x in range(k-2):
    for y in range(x+1,k-1):
        for z in range(y+1,k):
            if b[x]^b[y]^b[z]==0:
                if a.count(b[x])==a.count(b[y])==a.count(b[z])==n/3:
                    print('Yes')
                    exit()

print('No')