import itertools

def checkXOR(a, b, c):
  if bin(b) == bin(a ^ c):
    return False
  else:
    return True
    
n = int(input())
a = list(map(int, input().split()))
#print(n, a)
all = list(itertools.permutations(a))
ff = False
for p in range(0, len(all)):
  for i in range(0, n):
    if i == 0:
      ff = checkXOR(all[p][n-1],all[p][i],all[p][i+1])
    elif i == n-1:
      ff = checkXOR(all[p][i-1],all[p][i],all[p][0])
    else:
      ff = checkXOR(all[p][i-1],all[p][i],all[p][i+1])
    if ff:
      break
  if ff:
    break

if ff:
  print("No")
else:
  print("Yes")