N = int(input())
a = list(map(int,input().split()))
b = [0]*N
for i in range(N):
    ai = a[i]
    cnt = 0
    while ai > 1:
        ai=ai//2
        cnt += 1
    b[i] = (cnt,a[i])
b.sort()
c=[0]*(N)
for i in range(N):
    if i%2 == 0:
        c[i] = b[i][1]
    else:
        c[i] = b[N-i][1]

for i in range(N-1):
    if c[i]*c[i+1]%4 !=0:
        print("No")
        exit()
    else:
        continue
print("Yes")