import collections
n=input()
a=list(map(int,input().split()))
b=set(a)
c=list(b)
c.sort()
cnt=collections.Counter(a)
if len(b)==1:
  if c[0]==0:
    print('Yes')
if len(b)==2:
  if c[0]==0 and cnt[c[1]]%2==0 and cnt[c[0]]*2>=cnt[c[1]]:
    print('Yes')
if len(b)==3:
  if c[0]==0:
    print('No')
  else:
    if cnt[c[0]]==cnt[c[1]]==cnt[c[2]]:
      if c[0]^c[1]==c[2]:
        print('Yes')
else:
  print('No')