N=int(input())
A=list(map(int, input().split()))

x=len(set(A))
if x==1:
  if A==[0]*N:
    print('Yes')
  else:
    print('No')
elif x==2:
  B=list(set(A))
  a,b=max(B),min(B)
  if b==0 and A.count(0)==(N//3)*2:
    print('Yes')
  else:
    print('No')
elif x==3:
  B=list(set(A))
  a=max(B)
  c=min(B)
  b=sum(B)-a-c
  if A.count(a)==A.count(b) and A.count(b)==A.count(c):
    if a^b==c and b^c==a and c^a==b:
      print('Yes')
    else:
      print('No')
  else:
    print('No')
else:
  print('No')