import itertools

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

for s in list(itertools.permutations(l)):
    for i in range(n):
        if [s[(i-1)%n]^s[(i+1)%n] for i in range(n)]==s:
            print('Yes')
            exit()
        else:pass
print('No')