import itertools
n = int(input())
a = list(map(int, input().split()))

ab = list(itertools.permutations(a[1:]))
abc = [[0]*(n+1) for _ in range(len(ab))]

ans = 'No'

for i in range(len(ab)):
  abc[i] = list(ab[i])
  abc[i].append(a[0])
  abc[i].append(a[1])

  for j in range(1,n):
    if bin(abc[i][j-1]^abc[i][j+1]) != bin(abc[i][j]):
      break
    if j == n-1:
      ans = 'Yes'

    
print(ans)