N = int(input())
A = list(map(int,input().split()))
def solve(A):
  if len(A) % 3 != 0: return False
  count = {}
  for x in A:
    if x not in count:
      count[x] = 0
    count[x] += 1
    
  xs = []
  for k, v in count.items():
    if v % (N//3) != 0: return False
    for _ in range(v // (N//3)):
      xs.append(k)
  return (xs[0] == xs[1] ^ xs[2]) or (xs[1] == xs[2] ^ xs[0]) or (xs[2] == xs[0] ^ xs[1])

print('Yes' if solve(A) else 'No')
