n=int(input())

def xor(x,y):
    return ((x and y) or (not (x or y)))

def change(x):
    da=[True for i in range(31)]
    for i in da:
        da[i]=bool(x%2)
        x/=2
    return da

da=list(map(int,input().split()))
di={}
ans=False
for i in da:
    if i in di.keys():
        di[i]+=1
    else:
        di[i]=1
va=list(di.values())
ke=list(di.keys())
if len(di)==3:
    if va[0]==va[1] and va[0]==va[2]:
        if va[0]^va[1]==va[2]:
            ans=True
elif len(di)==2:
    if va[0]==va[1]*2 or va[1]==va[0]*2:
        ko=[change(i) for i in ke]
        for i in range(31):
            if not xor(xor(ko[0][i],ko[1][i]),ko[0][i]):
                break
            if i==30:
                ans=True
        for i in range(31):
            if not xor(xor(ko[0][i],ko[1][i]),ko[1][i]):
                break
            if i==30:
                ans=True

elif len(di)==1:
    if ke[0]==0:
        ans=True
if ans:
    print('Yes')
else:
    print('No')
    
