n = int(input())
A = [int(i) for i in input().split()]

a = A[0]
B = A[:]
B.sort()

for i in range(1, n):
    C = [a, A[i]]
    for j in range(2, n):
        C.append(C[j - 2] ^ C[j - 1])
    if C[-2] ^ C[-1] == C[0]:
        C.sort()
        if C == B:
            print('Yes')
            exit()

print('No')