N = int(input())
aaa = sorted([int(i) for i in input().split()])
ini = aaa[0]
first = aaa[0]
for i in range(1,N):
    second = aaa[i]
    for j in range(N-1):
        next_hat = first^second
        #print(first,second,next_hat)
        if next_hat in aaa:
             aaa.remove(next_hat)
        else:
            break
        first = second
        second = next_hat
    else:
        if first&second==ini:
            print("Yes")
            exit()
print("No")
