import sys

def checker(a0,a1,tmp):
  a2=''
  b0=bin(a0)[2:]
  b1=bin(a1)[2:]
  if len(b0)<len(b1):
    b0,b1=b1,b0
  b1=b1.zfill(len(b0))
  for s0,s1 in zip(b0,b1):
    a2 = a2 + str( int(s0)^int(s1) )
  a2=int(a2,2)
  #print(a0,a1,a2)
  if a2 not in tmp:
    return 1
  else:
    tmp.remove(a2)
    if  len(tmp)==0:
      return 0
    checker(a1,a2,tmp)

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

bia=1
for i in range(N-1):
  tmp=A.copy()
  tmp.remove(A[i])
  for j in range(N-bia):
    tmp.remove(A[j+bia])
    if checker(A[i],A[j+bia],tmp) == 1:
      break
    else:
      print('Yes')
      sys.exit()
  bia+=1
print('No')