n=int(input())
a=list(map(int,input().split()))
a.sort()
b=set(a)
l=len(b)
if l==1:
  if a[0]==0:print("Yes")
  else:print("No")
  exit()
elif l==2 and 0 in b and n%3==0:
  if a[n//2-1]!=a[n//2]:print("Yes")
  else:print("No")
elif l!=3:print("No");exit()
if n%3!=0: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
d=sorted(ecount(a))
if b.pop()^b.pop()==b.pop() and d[0]==d[2]:print("Yes")
else:print("No")