import itertools

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

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

    for l in itertools.permutations(a):
        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(ans)
    return False

ret = get_ans(a, N)