n=int(input())
l = list(map(int,input().split()))
s = set(l)
sl = sorted(list(s))
if l.count(sl[0])==n and sl[0]==0:
  print("Yes")
elif n%3==0 and len(s)==2 and l.count(sl[1])//l.count(sl[0])==2 and sl[0]==0:
  print("Yes")
elif n%3==0 and len(s)==3 and l.count(sl[0])==l.count(sl[1])==l.count(sl[2]):
  if sl[0]^sl[1]^sl[2]==0:
    print("Yes")
  else:
    print("No")
else:
  print("No")
