n = int(input())
a = list(map(int, input().split()))
b = set(a)
if n%3!=0:
  print("No")
  exit()
elif len(b)==2:
  b = sorted(list(b))
  if b[0]==0 and a.count(0)==n//3 and a.count(b[1])==(n//3)*2:
    print("Yes")
    exit()
elif len(b)==3:
  b = sorted(list(b))
  p, q, r = b[0], b[1], b[2]
  if p^q==r or q^r==p or r^p==q:
    if a.count(b[0])==n//3 and a.count(b[1])==n//3 and a.count(b[2])==n//3:
      print("Yes")
      exit()
else:
  print("No")