n = int(input())
a = [int(s) for s in input().split(" ")]
dic_a = {}
for aa in a:
  if aa in dic_a:
    dic_a[aa] += 1
  else:
    dic_a[aa] = 0
a_set = list(dic_a.keys())
n_set = len(a_set)

if (n < 3):
  ans = False
elif 0 in a_set:
  ans = False
  for v in dic_a.values():
    if v >= 2:
      ans = True
      break
else:
  ans = False
  if 0 in a_set:
    for v in dic_a.values():
      if v >= 2:
        ans = True
        break
  if not ans:
    for i in range(n_set):
      for j in range(i + 1, n_set):
        aij = a_set[i] ^ a_set[j]
        if aij in a_set:
          ans = True
          break
      if ans:
        break

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