N=int(input())
L=list(map(int,input().split()))
a=L[0]
R=set(L)
for i in range(1,len(L)):
  if L[i]^a in R:
    ans=[a,L[i]^a,L[i]]
    break
  if i==len(L)-1:
    print("No")
    exit()
for i in range(N-3):
  ans.append(L[-2]^L[-1])
ans=sorted(ans)
L=sorted(L)
if L[-2]^L[0]!=L[-1]:
  print("No")
  exit()
if ans==L:
  print("Yes")
else:
  print("No")