import itertools

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

def get_ans(a, N):
    for l in itertools.permutations(a):
        ans = 'Yes'
        a_tmp = list(l)
        if a_tmp[0] != a[0]:
            continue
        a_tmp.extend(a_tmp[:2])

        for x in range(N):
            if int(bin(a_tmp[x]^a_tmp[x+2]), 0) != a_tmp[x+1]:
                ans = 'No'
                break
        if ans == 'Yes':
            print(ans)
            return True
    print('No')
    return False

ret = get_ans(a, N)