

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
##############################

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

ans = 1
before = None
for a in A:
    if before != None:
        if before * a < 4:
            print('No')
            exit()

    ans *= a
    before = a

print('Yes' if ans % 4 == 0 else 'No')