n = int(input())
l = list(map(int, input().split()))
l.sort()

for i in range(n):
  if i == 0:
    m = [l[-1], l[0], l[1]]
  elif i == n-1:
    m = [l[n-2], l[n-1], l[0]]
  else:
    m = [l[i-1], l[i], l[i+1]]
  p = len(bin(max(m)))-2
  for j in range(p):
    if ((j >> m[0]) + (j >> m[1]) + (j >> m[2]))%2 == 0:
      continue
    else:
      print('No')
      exit()
else:
  print('Yes')