import itertools
N = int(input())
A = list(map(int, input().split()))

list_length = len(A)

A_except_first = A[1:]

B = list(itertools.permutations(A_except_first))
B_len = len(B)
C = []
for i in range(B_len):
    C.append([A[0]] + list(B[i]))

count_true = []
    
C_len = len(C)
for i in range(C_len):
    for j in range(B_len):
        if j == 0:
            if C[i][1] ^ C[i][-1] == C[i][0]:
                count_true.append('True')
            else:
                print('No')
                break
        if C[i][j - 1] ^ C[i][j + 1] == C[i][j]:
            count_true.append('True')
        else:
            print('No')
            break
    else:
        continue
    break
if len(count_true) ==  len(A) * len(C):
    print('Yes')