import itertools
N = int(input())
a = list(map(int, input().split()))
aa = list(itertools.permutations(a))

answer = "Yes"
for i in range(len(aa)):
  for j in range(len(aa[i]) - 1):
    if aa[i][j] != (aa[i][j - 1] ^ aa[i][j + 1]):
      answer = "No"
      break
    if answer == "No":
      break
    
print(answer)
