n = int(input())

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

for i in range(1, len(a)):
    ans = a[i-1] * a[i]
    if ans % 4 == 0:
        if i + 1 == len(a):
            print("YES")
        else:
            continue

    else:
        if i != len(a)-1:
            for j in range(0, len(a)-1):
                kari = a[i]
                a[i] = a[i+j]
                if a[i-1] * a[i] % 4 == 0:
                    a[i+j] = kari
                    break
                else:
                    if i + j - 1 <= len(a)-1:
                        continue
                    else:
                        print("NO")
        else:
            print("NO")
            break
