n = int(input())
a = [int(s) for s in input().split(" ")]
a_set = set(a)
n_set = len(a_set)

if (n < 3):
  ans = False
else:
  ans = False
  for i in range(n_set):
    for j in range(i + 1, n_set):
      if a_set[i] ^ a_set[j] in a_set:
        ans = True
        break
    if ans:
      break

print("Yes" if ans else "No")