import sys
from collections import Counter

N = int(input())
a = list(map(int,input().split()))
a.sort()
YES = 'Yes'
NO = 'No'
if a == [0]*N:
  print(Yes)
  sys.exit()
  
if N%3 !=0:
  print(NO)
  sys.exit()
  
counter = Counter(a)
if len(counter) > 3:
  print(NO)
  sys.exit()
elif len(counter) == 3:
  if list(counter.values()) != [N//3,N//3,N//3]:
    print(NO)
  else:
    xor = 0
    for key in counter.keys():
      xor ^= key
    if xor == 0:
      print(YES)
    else:
      print(NO)
  sys.exit()
elif len(counter) == 2:
  if counter.items[0][0] == 0 and counter.items[0][1] == N//3:
    print(YES)
  else:
    print(NO)
  sys.exit()

print(NO)