from collections import Counter
N=int(input())
a=list(map(int, input().split()))
flag=False
if N%3==0:
  c=Counter(a)
  if len(c.keys())==1:
    if 0 in c.keys():
      flag=True
  elif len(c.keys())==2:
    if 0 in c.keys():
      if c[0]*3==N:
        flag=True
  elif len(c.keys())==3:
    x, y, z=c.keys()
    if c[x]==c[y] and c[y]==c[z] and x^y==z:
      flag=True
if flag:
  print("Yes")
else:
  print("No")