import copy
def exc_or(int1, int2):
  exc_or = bin(int1^int2)
  return int(exc_or, 2)

N = int(input())
alist = list(map(int, input().split()))
tmp_alist = copy.copy(alist)

exc_ors = []
for i in range(N-1, -1, -1):
  value = exc_or(alist[i-1], alist[i])
  if value in tmp_alist:
    tmp_alist.remove(value)
  else:
    print("No")
    exit()
print("Yes")    