N=int(input())
A=[int(x) for x in input().split()]
bit=[bin(x^y) for x in A for y in A]
B=sorted(set(bit))
AA=[]
for a in A:
  AA.append(bin(a))
if all(a in B for a in AA):
  print("Yes")
else:
  print("No")