N=int(input())
a=list(map(int, input().split()))
s=set(a) # 検索用
from collections import Counter
d=Counter(a) # 重複用
for i in range(1, N):
  tmp=a[0]^a[i]
  if tmp not in s:
    print("No")
    exit()
print("Yes")
