N = int(input())

a = [int(x) for x in input().split()]

for i in range(N):
    for j in range(i + 1, N):
      if int(bin(a[i]^a[j]),0) not in a:
        print('No')
        exit()
        
print('Yes') 