n = int(input())
a = list(map(int, input().split()))

counter = {}
nkey = 0
for i in range(n):
  if a[i] in counter.keys():
    counter[a[i]] += 1
  else:
    counter[a[i]] = 1
    nkey += 1
  if nkey >= 4:
    print('No')
    break
else:
  if nkey == 3:
    for key in counter.keys():
      if counter[key] != n // 3:
        print('No')
        break
    else:
      a = list(set(a))
      if a[0]^a[1]^a[2] == 0:
        print('Yes')
      else:
        print('No')
  else:
    print('No')