import itertools

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

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