n = int(input())
import collections
c = collections.Counter(list(map(int,input().split())))
k = list(c.keys())
v = list(c.values())
if len(k)==3 and k[0]^k[1]==k[2] and k[1]^k[2]==k[0] and k[2]^k[0]==k[1] and v[0]==v[1]==v[2]:
  print("Yes")
elif len(k)==2 and v[k.index(0)]==sum(v)*2/3:
  print("Yes")
elif k == [0]:
  print("Yes")
else:
  print("No")