def doMaths(one, two):
    i = max(len(one), len(two))
    ans = ""
    while i -1>= 0:
        if len(one) < i:
            i -= 1 
            ans += two[i -1]
            continue
        if len(two) < i:
            i -= 1
            ans += one[i -1]
            continue
        ans += str((int(one[i -1]) + int(two[i -1]))%2)
        i -= 1
    return ans

n = int(input())
hats = input()
hatnums = hats.split(" ")
hatnums2 = []
for hat in hatnums:
    hatnums2.append(bin(int(hat))[2:])
for hatnum in hatnums2:
    for hatnum2 in hatnums2:
        if hatnum2 != hatnum:
            if not doMaths(hatnum, hatnum2) in hatnums2:
                print('No')
                exit()
print('Yes')