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

import itertools

def xorcircle(s,m):
    for t in range(m):
        if s[t-1] ^ s[t+1] != s[t]:
            return False
        else:
            return True
        
l = list(itertools.permutations(a))
m = len(l)

for i in range(m):
    if xorcircle(l[i],n) == True:
        print('Yes')
        break
else:
    print('No')