n = int(input())
d = {}
for i in input().split():
  i = int(i)
  if i in d:
    d[i] += 1
  else:
    d[i] = 1

if 0 in d and d[0] == n:
  print('Yes')
elif len(d.keys()) == 2 and n%3 == 0 and 0 in d and d[0] == n//3:
  print('Yes')
elif len(d.keys()) == 3 and n%3 == 0:
  x = 0
  for i in d.keys():
    x ^= i
    if d[i] != n//3:
      print('No')
  if x == 0:
    print('Yes')
  else:
    print('No')
else:
  print('No')