import itertools

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



for v in itertools.permutations(line,n):
  flg = q(list(v))
  if flg:
    print('Yes')

print('No')

	