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