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

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

a_unique = list(set(a))
if len(a_unique) > 3:
    result = False

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