n = int(input())
figure = list(map(int, input().split()))
p=0
for i in range(n-2):
  for j in range(i+1,n-1):
    if figure[i]^figure[j] in figure:
      print("Yes")
      p+=1
      break
  else: 
    continue
    break
if p==0:
  print("No")