def get_caps(a):
  dic = dict()

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

  return dic


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)


def can_put_on_cap(n):
  global caps

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


# A - XOR Circle
import sys
input = sys.stdin.readline
import copy

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

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

for i in range(N):
  for j in range(i+1, N):
    caps = copy.deepcopy(dic)
    caps[a[i]] -= 1
    caps[a[j]] -= 1
        
    left = a[i]
    mid = a[j]
    count = 2
    
    for k in range(N-2):
      right = get_xor(left, mid)
    
      if can_put_on_cap(right):
        left = mid
        mid = right
        count += 1
      else:
        break
    
    if count == N:
      if mid ^ a[i] == right:
            print('Yes')
            exit()

print('No')