import itertools

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

def get_ans(a, N):
    ans = 'Yes'
    for l in itertools.permutations(a):
        a_tmp = list(l)
        if a_tmp[0] != a[0]:
            continue
        a_tmp.extend(a_tmp[:2])
        
        a_plus = [ int(bin(a_tmp[x]^a_tmp[x+2]), 0) for x in range(N) ]
        if a_tmp != a_plus:
            ans = 'No'
            break
    print(ans)
    return True

ret = get_ans(a, N)