from collections import defaultdict
from functools import reduce
N = int(input())
A = [int(x) for x in input().split()]
def isExist(N, A):
  AD = defaultdict(int)
  for a in A:
    AD[a] += 1
  keys = len(AD.keys())
  xor = reduce(lambda x, y: x^y, AD.keys())
  mlen = min([a for a in AD.values()])
  if xor != 0:
    return 'No'
  if keys == 1:
    return 'Yes'
  if keys == 2 and N % 3 == 0 and mlen == N // 3:
    return 'Yes'
  if keys == 3 and N % 3 == 0 and mlen == N // 3:
    return 'Yes'
  return 'No'
print(isExist(N, A))