n=int(input())
a=list(map(int,input().split()))
result = True

a_unique = list(set(a))

if len(a_unique) > 3:
    result = False

for i in range(len(a_unique)-1):
    for j in range(i+1,len(a_unique)):
        if a_unique[i]^a_unique[j] in a:
            pass
        else:
            result = False

if result:
    print("Yes")
else:
    print("No")