N=int(input())
a=list(map(int,input().split()))
D=dict()
for i in range(N):
    if a[i] in D:
        D[a[i]]+=1
    else:
        D[a[i]]=1
L=list(D.items())
L.sort()
#print(L)

if len(L)==1:
    print("Yes")
    exit()
elif len(L)==2:
    if L[0][0]==0 and L[1][1]==L[0][1]*2:
        print("Yes")
        exit()
elif len(L)==3:
    #print(1)
    if L[0][1]==L[1][1] and L[1][1]==L[2][1]:
        #print(2)
        if L[1][0]==L[0][0]^L[2][0] and L[2][0]==L[1][0]^L[0][0] and L[0][0]==L[1][0]^L[2][0]:
            print("Yes")
            exit()
print("No")
            