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()))
ff = False
for p in list(itertools.permutations(a)):
  for i in range(0, n):
    if i == 0:
      ff = checkXOR(p[n-1],p[i],p[i+1])
    elif i == n-1:
      ff = checkXOR(p[i-1],p[i],p[0])
    else:
      ff = checkXOR(p[i-1],p[i],p[i+1])
    if ff:
      break
  if ff:
    break

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