import itertools
import sys
import copy

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

def q(line):
  flg = True
  for i in range(len(line)):
    max = i + 1
    min = i - 1
    if i + 1 > n - 1:
      max = 0
    elif i - 1 < 0:
      min = n - 1
    wa = line[min] ^ line[max]
    if line[i] != wa:
      flg = False
  return flg

# 1回やる
flg = q(line)
if flg:
  print('Yes')
  sys.exit()

# 数字
for i in line:
  line2 = copy.copy(line)
  line2.remove(i)
  flg = True
  for v in itertools.permutations(line2,2):
    if i == list(v)[0] ^ list(v)[1]:
      flg = False
      break
  if flg:
    print('No')
    sys.exit()

print('Yes')

