import sys
input = sys.stdin.readline

# A - XOR Circle
def get_caps(a):
  dic = dict()

  for ai in a:
    dic.setdefault(ai, 0)
    dic[ai] += 1

  return dic


def can_put_on_cap(n):
  global caps

  if n in caps.keys():
    if caps[n] > 0:
      caps[n] -= 1
      return True


def get_xor(a, b):
  bin_a = format(a, 'b')
  bin_b = format(b, 'b')

  digit = max(len(bin_a), len(bin_b))

  # 2進数のケタ数を揃える
  bin_a = bin_a.zfill(digit)
  bin_b = bin_b.zfill(digit)
  s = ''

  for i in range(len(bin_a)):
    if bin_a[i] == '0' and bin_b[i] == '1':
      s += '1'
    elif bin_a[i] == '1' and bin_b[i] == '0':
      s += '1'
    else:
      s += '0'

  # 10進数に戻す
  return int(s, 2)


import itertools
import copy

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

# 帽子の情報をdictに入れる
caps_original = get_caps(a)

# 1,3番目のラクダを先に決めておく
combis = list(itertools.combinations(a, 2))

for c in combis:
  caps = copy.deepcopy(caps_original)
  count = 0
  xor = 0

  if can_put_on_cap(c[0]):
    count += 1

    if can_put_on_cap(c[1]):
      camels = [0] * N
      camels[0] = c[0]
      camels[2] = c[1]
      count += 1

      # 2番目のラクダの帽子が決まる
      camels[1] = camels[0] ^ camels[2]

      if can_put_on_cap(camels[1]):
        count += 1

        for i in range(1, N - 2):
          xor = get_xor(camels[i], camels[i + 2])

          if can_put_on_cap(xor):
            camels[i + 1] = xor
            count += 1
          else:
            break

        if count == N:
          if camels[N - 2] ^ camels[0] == camels[N - 1]:
            print('Yes')
            exit()

print('No')