from itertools import permutations

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

Flag = False

perm = list(permutations(range(n)))

for item in perm:
    flag = True
    for i in range(n):
        if line[item[i]] != line[item[(i-1)%n]] ^ line[item[(i+1)%n]]:
            flag = False
    if flag:
        Flag = True

if flag:
    print('Yes')
else:
    print('No')