import sys
import itertools

input = sys.stdin.readline

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

one_value = a.pop()
# print(one_value)

permutation_list = list(itertools.permutations(a))
# print(permutation_list)


new_permutation_list=[]

for value in permutation_list:
    tmp=list(value)
    tmp.insert(0,one_value)
    new_permutation_list.append(tmp)

# print(new_permutation_list)

# for i in range(len(new_permutation_list)):
#     for j in range(len(new_permutation_list[0])):
#         new_permutation_list[i][j]=bin(new_permutation_list[i][j])

flag_global=False
for i in range(len(new_permutation_list)):
    flag_local=True
    for j in range(len(new_permutation_list[0])):
        if j == len(new_permutation_list[0])-1:
            if new_permutation_list[i][j - 1] ^ new_permutation_list[i][0] != new_permutation_list[i][j]:
                flag_local = False
                break
            continue

        if new_permutation_list[i][j-1] ^ new_permutation_list[i][j+1] != new_permutation_list[i][j]:
            flag_local=False
            break

    if flag_local == True:
        flag_global=True
        break

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