n=int(input())
a=list(map(int,input().split()))
a.sort()
b=set(a)
l=len(b)
if l==2:
  c=sorted([b.pop(),b.pop()])
  if c[1]^c[0]==c[1] and a[(n+1)//2-1]==0:print("Yes")
  else:print("No")
  exit()
elif l==1:
  if a[0]==0:print("Yes")
  else:print("No")
  exit()
def ecount(X):
  c,ans=1,[]
  for i in range(len(X)-1):
    if X[i]==X[i+1]:c+=1
    else:
      ans.append(c);c=1
  ans.append(c)
  return ans
for i in range(n):
  if a[i]!=0:d=ecount(a[i:]);z=i;break
if l-(0 in b)!=3:print("No");exit()
if 0 in b:b.discard(0)
print(b)
for i in range(z):
  d.sort()
  d[-1]-=1
d.sort()
if d[0]>0 and b.pop()^b.pop()^b.pop()==0 and d[0]==d[2]:print("Yes")
else:print("No")