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