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

def get_ans(a, N):
    ans = 'Yes'
    for l in list(itertools.permutations(a)):
        a_tmp = list(l)
        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'
                print(ans)
                return 'False'
    print(ans)
    return True

ret = get_ans(a, N)