We have a sequence of length N, a = (a_1, a_2, ..., a_N).
Each a_i is a positive integer.
Snuke's objective is to permute the element in a so that the following condition is satisfied:
 - For each 1 ≤ i ≤ N - 1, the product of a_i and a_{i + 1} is a multiple of 4.
Determine whether Snuke can achieve his objective.

-----Constraints-----
 - 2 ≤ N ≤ 10^5
 - a_i is an integer.
 - 1 ≤ a_i ≤ 10^9

-----Input-----
Input is given from Standard Input in the following format:
N
a_1 a_2 ... a_N

-----Output-----
If Snuke can achieve his objective, print Yes; otherwise, print No.

-----Sample Input-----
3
1 10 100

-----Sample Output-----
Yes

One solution is (1, 100, 10).

Difficulty: introductory

Starter code:

Solutions:
#!/usr/bin/env python

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

n2 = 0 
n4 = 0 
for i in range(n):
    if a[i]%4 == 0:
        n4 += 1
    elif a[i]%2 == 0:
        n2 += 1

ok = True
if n2 == 0:
    if n4 >= n//2:
        ok = True
    else:
        ok = False
else:
    n1 = n-n2-n4
    n1 += 1
    nn = n1+n4
    if n4 >= nn//2:
        ok = True
    else:
        ok = False

if ok: 
    print('Yes')
else:
    print('No')

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

four = 0
odd = 0
for a in A:
    if a % 2 == 1:
        odd += 1
    if a % 4 == 0:
        four += 1
if N % 2 == 1:
    if odd - four <= 1:
        print("Yes")
    else:
        print("No")
else:
    if odd - four <= 0:
        print("Yes")
    else:
        print("No")

n = int(input())
a, b = 0, 0
for i in map(int, input().split()):
    if i % 4 == 0:
        a += 1
    elif i % 2 == 0:
        b += 1
c = n - a - b
if b == 0:
    if a + 1 < c:
        print("No")
    else:
        print("Yes")
else:
    if a < c:
        print("No")
    else:
        print("Yes")

n=int(input())
a=list(map(int,input().split()))
s=0
t=0
u=0
for i in range(n):
  if a[i]%4==0:
    s=s+1
  elif a[i]%2==0:
    t=t+1
  else:
    u=u+1
if t>=1:
  if s>=u:
    print("Yes")
  else:
    print("No")
else:
  if s-u>=-1:
    print("Yes")
  else:
    print("No")
    


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

four = 0
two = 0
other = 0
for i in a:
    if i % 4 == 0:
        four += 1
    elif i % 2 == 0:
        two += 1
    else:
        other += 1

ans = 'No'
other += two % 2
if four + 1 >= other:
    ans = 'Yes'

print(ans)

def main():
    n = int(input())
    As = list(map(int, input().split()))
    fours = 0
    evens = 0
    odds = 0
    for A in As:
        if A % 4 == 0:
            fours += 1
        elif A % 2 == 0:
            evens += 1
        else:
            odds += 1

    if fours+(evens)//2 >= n//2:
        ans = 'Yes'
    else:
        ans = 'No'
    print(ans)


def __starting_point():
    main()

__starting_point()

N = int(input())
d4 = 0
d2 = 0
for i in list(map(int,input().split())):
    if i % 4 == 0:
        d4 += 1
    elif i % 2 == 0:
        d2 += 1
    else:
        None
if N <= d4*2 + 1:
    print("Yes")
elif N - d4 * 2 <= d2 :
    print("Yes")
else:
    print("No")

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

num2 = 0
num4 = 0
odd = 0
for i in a:
    if i % 4 == 0:
        num4 += 1
        continue
    elif i % 2 == 0:
        num2 += 1
        continue
    else:
        odd += 1
        continue
if odd<=num4 or (N%2==1 and num4==N//2):
    print('Yes')
else:
    print('No')


#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate, product # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
# my_round_int = lambda x:np.round((x*2 + 1)//2)
# 四捨五入g
import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
n = I()
A = readInts()
four = 0
two = 0
for i in range(n):
    if A[i]%4 == 0:
        four += 1
    elif A[i]%2 == 0:
        two += 1
print(('Yes' if four + two//2 >= n//2 else 'No'))


#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	C
# CreatedDate:  2020-09-04 15:44:42 +0900
# LastModified: 2020-09-13 16:06:20 +0900
#


import os
import sys
# import numpy as np
# import pandas as pd


def main():
    n = int(input())
    A = list(map(int, input().split()))
    A_4 = [x for x in A if x % 4 == 0]
    A_2 = [x for x in A if x % 4 != 0 and x % 2 == 0]
    A_0 = [x for x in A if x % 2 != 0]
    if len(A_2) == 0 and len(A_0) <= len(A_4) + 1:
        print("Yes")
    elif len(A_0) <= len(A_4):
        print("Yes")
    else:
        print("No")

def __starting_point():
    main()

__starting_point()

N = int(input())
A = [int(a) for a in input().split(" ")]

m_2_but_4 = 0
m_4 = 0
m_none = 0
for i in range(len(A)):
  if A[i] % 4 == 0:
    m_4 += 1
  elif A[i] % 2 == 0:
    m_2_but_4 += 1
  else:
    m_none += 1

if m_2_but_4:
  print("Yes") if m_4 >= m_none else print("No")
else:
  print("Yes") if m_4 + 1 >= m_none else print("No")

import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N, *A = list(map(int, read().split()))
    
    m = sum(1 for a in A if a % 2 == 1)
    n2 = sum(1 for a in A if a % 2 == 0 and a % 4 != 0)
    n4 = sum(1 for a in A if a % 4 == 0)
    
    if m <= n4:
        print('Yes')
    elif m == n4 + 1:
        if n2 == 0:
            print('Yes')
        else:
            print('No')
    else:
        print('No')
    
    return


def __starting_point():
    main()

__starting_point()

N=int(input())
ls=[int(s) for s in input().split()]
a0=0
a2=0
for n in ls:
  if n%2==1:
    a0+=1
  elif n%4==0:
    a2+=1
if a2>a0-1:
  print('Yes')
elif a2==a0-1:
  if a0+a2<N:
    print('No')
  else:
    print('Yes')
else:
  print('No')

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

x,y,z=0,0,0
for i in a:
    if i%4 == 0:
        z+=1
    elif i%2 == 0:
        y+=1
    else:
        x+=1
if y:
    if x <= z:
        print('Yes')
    else:
        print('No')
else:
    if x <= z+1:
        print('Yes')
    else:
        print('No')

N=int(input())
a=list(map(int,input().split()))
l=[0]*N
for i in range(N):
    if a[i]%4:
        if a[i]%2:l[i]=1
        else:l[i]=2
    else:l[i]=4
print('Yes'if l.count(1)+(1 if l.count(2)else 0)<=1+l.count(4)else'No')

n = int(input())
a = [int(x) for x in input().split()]
res = "No"

def check(p):
  if p % 4 == 0:
    return 2
  elif p % 2 == 0:
    return 1
  else:
    return 0
  
c0 = 0
c2 = 0
c4 = 0
for i in range(n):
  a[i] = check(a[i])
  if a[i] == 2:
    c4 += 1
  elif a[i] == 1:
    c2 += 1
  else:
    c0 += 1
    
if c0 == c4 + 1 and c2 == 0:
  res = "Yes"
elif c0 <= c4:
  res = "Yes"

print(res)

##
N = int(input())
N_List = list(map(int,input().split()))
Four_List = [i for i in N_List if i % 4 == 0]
Two_List = [i for i in N_List if i % 2 == 0]
if len(Two_List)-len(Four_List) > 0:
    N = N - (len(Two_List) - len(Four_List)) + 1

if N // 2 <= len(Four_List):
    print("Yes")
else:
    print("No")

def even(x):
    flag1 = False
    if x % 2 == 0:
        flag1 = True
    return flag1


def multiple_of_4(x):
    flag2 = False
    if x % 2 == 0:
        x //= 2
        if x % 2 == 0:
            flag2 = True
    return flag2


def main():
    n = int(input())
    a_lst = list(map(int, input().split()))
    flag = False

    multiple_of_4_count = 0
    for i in range(n):
        if multiple_of_4(a_lst[i]):
            multiple_of_4_count += 1

    if multiple_of_4_count >= n // 2:
        flag = True
    else:
        even_count = 0
        for i in range(n):
            if even(a_lst[i]):
                even_count += 1
        tmp = n - 2 * multiple_of_4_count
        even_count -= multiple_of_4_count

        if even_count >= tmp:
            flag = True

    if flag:
        print('Yes')
    else:
        print('No')


def __starting_point():
    main()
__starting_point()

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

for a in A:
  if a%4==0:
    x+=1
  elif a%2==0:
    y+=1

if N//2<=x+y//2:
  print("Yes")
else:
  print("No")

from collections import deque

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

cnt_2 = 0
cnt_4 = 0
for i in range(n):
    a = A[i]
    if a%4==0:
        cnt_4+=1
    elif a%2==0:
        cnt_2+=1
cnt_else = n-cnt_2-cnt_4
cnt_else += cnt_2%2

if cnt_else-1 <= cnt_4:
    print("Yes")
else:
    print("No")

n=int(input())
a=[int(i) for i in input().split()]

A_num=0
B_num=0
C_num=0

for i in a:
    if i%4==0:
        C_num+=1
    elif i%2==0:
        B_num+=1
    else:
        A_num+=1

def ans():
    if A_num==1:
        if C_num>=1:
            return True
        return False
    else:
        if n==2*A_num-1:
            if C_num==A_num-1:
                return True
            return False

        elif n<2*A_num-1:
            return False
        else:
            if C_num>=A_num:
                return True
            return False
if ans():
    print("Yes")
else:
    print("No")


n=int(input())
a=list(map(int, input().split()))
x = 0
y = 0
for i in a:
    if i %2 != 0:
        x+=1
    elif i%4 == 0:
        y+=1
if y >=x:
    print('Yes')
    return
else:
    if x+y == len(a) and y == x-1:
        print('Yes')
    else:
        print('No')

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

cnt2 = 0
cnt4 = 0
cntodd = 0
for i in a:
    if i % 4 == 0:
        cnt4 += 1
    elif i % 2 == 0:
        cnt2 += 1
    else:
        cntodd += 1

if cnt2 == 0 and cnt4 + 1 >= cntodd:
    ans = 'Yes'
elif cnt4 >= cntodd:
    ans = 'Yes'
else:
    ans = 'No'
print(ans)    


N = int(input())
a = list(map(int,input().split()))
sa=[]
c = [0]*4
ans = 'No'

#4で割った余り一覧表作成
for i in a:
    sa.append(i%4)
        
for i in sa:
    c[i]+=1
    
#2の倍数がない時、奇数の数の和が4の倍数の個数+1以下ならOK  
if c[2]==0:
    if c[1]+c[3]<=c[0]+1:
        ans = 'Yes'
#2の倍数がある時、まとめて端に寄せて、奇数個でも偶数個でも奇数1個分の扱いになる
#よって奇数の数の和が4の倍数の個数以下であればOK
else:
    if c[1]+c[3]<=c[0]:
        ans = 'Yes'

#print(c)
print(ans)

N = int(input())
a = list(map(int, input().split()))
count = 0
hcount = 0
for x in a:
    if x % 4 == 0:
        count += 1
    elif x % 2 == 0:
        hcount += 1

if (count + (hcount // 2)) >= (N // 2):
    print('Yes')
else:
    print('No')


from collections import Counter
n=int(input())
a=list(map(int,input().split()))
amod4=list([x%4 for x in a])
d=Counter(amod4)
if n-d[0]-d[2]<d[0]+1:
  print('Yes')
elif d[2]==0 and n==2*d[0]+1:
  print('Yes')
else:
  print('No')


#import
#import math
#import numpy as np
N = int(input())
#= input()
#= map(int, input().split())
a = list(map(int, input().split()))
#= [input(), input()]
#= [list(map(int, input().split())) for _ in range(N)]
#= {i:[] for i in range(N)}

alen = N
two = 0
four = 0

for aa in a:
    if aa % 4 == 0:
        four += 1
    elif aa % 2 == 0:
        two += 1

other = alen - two - four

res = False

if other > four + 1:
    pass
elif other == four + 1:
    if two == 0:
        res = True
else:
    res = True

if res:
    print("Yes")
else:
    print("No")

_ = input()
a = [int(x) for x in input().split()]

odd = []
m4 = []
m2 = 0
for i in a:
    if i % 2 != 0:
        odd.append(i)
    elif i % 4 == 0:
        m4.append(i)
    else:
        m2 = 1
else:
    lodd = len(odd)
    if lodd == 0 or lodd + m2 - 1 <= len(m4):
        print("Yes")
    else:
        print("No")

n=int(input())
a=list(map(int,input().split()))
one=0
four=0
two=0
for i in range(n):
    cnt=0
    num=a[i]
    while num%2==0:
        cnt+=1
        num//=2
    if cnt==0:
        pin=1
    elif cnt==1:
        pin=2
    else:
        pin=4
    if pin==1:
        one+=1
    elif pin==4:
        four+=1
    else:
        two+=1
if two>0:
    one+=1
if one<=four+1:
    print("Yes")
else:
    print("No")


n = int(input())
a = list(map(int,input().split()))
t = [0 for _ in range(3)]

for i in range(n):
	if a[i] % 2 == 0:
		if a[i] % 4 == 0:
			t[2] += 1
		else:
			t[1] += 1
	else:
		t[0] += 1

if t[0] + (t[1]%2) <= t[2] + 1:
	print("Yes")
else:
	print("No")

n = int(input())
a = list(map(int, input().split()))
four = 0
two = 0
for i in range(n):
    if a[i] % 4 == 0:
        four += 1
    elif a[i] % 2 == 0:
        two += 1

if 2 * four + 1 >= n:
    print("Yes")
elif 2 * four + two >= n:
    print("Yes")
else:
    print("No")


import math
N = int(input())
A = list(map(int, input().split()))
count = []
for i in A:
    if i%4 == 0:
        count.append("4")
    elif i%2 == 0:
        count.append("2")
    else:
        count.append("1")
B1 = count.count("4")
B2 = count.count("1")
if count.count("2") == 0:
    print("Yes" if B1+1 >= B2 else "No")
else:
    print("Yes" if B1 >= B2 else "No")

_ = input()
a = [int(x) for x in input().split()]

odd = []
m4 = []
m2 = 0
for i in a:
    if i % 2 != 0:
        odd.append(i)
    elif i % 4 == 0:
        m4.append(i)
    else:
        m2 = 1
else:
    if len(odd) + m2 - 1 <= len(m4):
        print("Yes")
    else:
        print("No")

n = int(input())
a_lst = list(map(int, input().split()))

cnt = 0
for a in a_lst:
  if a % 4 == 0:
    cnt += 2
  elif a % 2 == 0:
    cnt += 1
  else:
    pass

if cnt // 2 >= n // 2:
  print('Yes')
else:
  print('No')

N=int(input())
a=list(map(int,input().split()))
for i in range(N):
    if a[i]%4==0:
        a[i]=2
    elif a[i]%2==0:
        a[i]=1
    else:
        a[i]=0
zero=a.count(0)
one=a.count(1)
two=a.count(2)

if zero>two+1:
    print("No")
elif zero==two+1:
    if zero+two==N:
        print("Yes")
    else:
        print("No")
else:
    print("Yes")


from collections import defaultdict

d = defaultdict(int)
d=[0]*3
n = int(input())

for i in list(map(int, input().split())):
  if i % 4 == 0:
    d[2] += 1
  elif i % 2 == 0:
    d[1] += 1
  else:
    d[0] += 1
t = d[2] - d[1]
if (d[0] <= d[2]) or ((d[0] == d[2] + 1) and (d[1] == 0)):
  print("Yes")
else:
  print("No")


#
# abc069 c
#
import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """3
1 10 100"""
        output = """Yes"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """4
1 2 3 4"""
        output = """No"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """3
1 4 1"""
        output = """Yes"""
        self.assertIO(input, output)

    def test_入力例_4(self):
        input = """2
1 1"""
        output = """No"""
        self.assertIO(input, output)

    def test_入力例_5(self):
        input = """6
2 7 1 8 2 8"""
        output = """Yes"""
        self.assertIO(input, output)


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

    Q = 0
    E = 0
    O = 0
    for a in A:
        if a % 4 == 0:
            Q += 1
        elif a % 2 == 0:
            E += 1
        else:
            O += 1

    if N-2*Q <= 0 or (N-2*Q) == 1 or N-2*Q == E:
        print("Yes")
    else:
        print("No")


def __starting_point():
    # unittest.main()
    resolve()

__starting_point()

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

ans="No"
c1=c2=c4=0
for a in A:
    if a%4==0:
        c4+=1
    elif a%2==0:
        c2+=1
    else:
        c1+=1

if c4==0 and c1>0 :
    ans="No"
elif c1<=c4+(c2==0) :
    ans="Yes"
else:
    ans="No"

print( ans )



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

n4,n2=0,0
for i in range(N):
  if a[i] % 4 == 0:n4 += 1
  elif a[i] % 2 == 0:n2 += 1
    
if n4 >= N//2:print('Yes')
elif n4*2 + n2 >= N:print('Yes')
else:print('No')

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

x2=0
x4=0
x1=0
for x in a:
  if x%2==0:
    x2+=1
  if x%4==0:
    x4+=1
  if x%2==1:
    x1+=1
    
if x4+x1==n:
  if x4>=x1-1:
    print('Yes')
  else:
    print('No')
  
else:
  if x4>=x1:
    print('Yes')
  else:
    
    print('No')


input();a=list(map(int,input().split()))
b1,b2,b4=0,0,0
for i in a:
  if i%2!=0: b1+=1
  elif i%4==0: b4+=1
  else: b2+=1
print('Yes' if b1<=b4 else 'No' if b2 else 'Yes' if b1<=b4+1 else 'No')

n = int(input())
an = [int(num) for num in input().split()]

one,two,four = 0, 0, 0
for a in an:
  if a%4 == 0:
    four += 1
  elif a%2 == 0:
    two += 1
  else :
    one += 1
    
if two == 0 and four >= one - 1 :
  print("Yes")
elif four >= one :
  print("Yes")
else :
  print("No")

N = int(input())
a = list(map(int,input().split()))
f = []
t = []
o = []
ans = 'No'

for i in a:
    if i%4==0:
        f.append(i)
    elif i%2==0:
        t.append(i)
    else:
        o.append(i)

if len(t)==0:
    if len(o)<=len(f)+1:
        ans = 'Yes'
else:
    if len(o)<=len(f):
        ans = 'Yes'
print(ans)

n=int(input())
a=list(map(int,input().split()))
x=0
y=0
for i in range(n):
  if a[i]%2!=0:
    x+=1
  elif a[i]%4==0:
    y+=1

if x<=y:
  print("Yes")
else:
  if x+y==n and x==y+1:
    print("Yes")
  else:
    print("No")

input();a,b,c,d,r=list(map(int,input().split())),0,0,0,'NYoe s'
for i in a:
  if i%2!=0: b+=1
  elif i%4==0: c+=1
  else: d+=1
print([r[b<=c::2],r[b<=c+1::2]][d==0])

n = int(input())
a = list(map(int, input().split()))
four = 0
two = 0
for i in range(n):
    if a[i] % 4 == 0:
        four += 1
    elif a[i] % 2 == 0:
        two += 1

if four >= n // 2 or n - 2 * four <= two:
    print("Yes")
else:
    print("No")


input();a=list(map(int,input().split()))
b1,b2,b4=0,0,0
for i in a:
  if i%2!=0: b1+=1
  elif i%4==0: b4+=1
  elif i%2==0: b2+=1
print('Yes' if b1<=b4 else 'No' if b2 else 'Yes' if b1<=b4+1 else 'No')

from collections import Counter

n = int(input())
A = list(map(int, input().split()))
A = [min(x & -x, 4) for x in A]

CA = Counter(A)
num0 = CA[1]
num1 = CA[2]
num2 = CA[4]
if num1:
    num1 = 1
if num2 - (num1 + num0) >= -1:
    print("Yes")

else:
    print("No")


n = int(input())
al = list(map(int, input().split()))

count2 = 0
count4 = 0

for a in al:
    if a % 4 == 0:
        count4 += 1
    elif a%2==0:
        count2+=1

v=count2//2

n-=v*2
if count4 >= n//2:
    ans='Yes'
else:
    ans='No'

print(ans)

import sys

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inl = lambda: [int(x) for x in sys.stdin.readline().split()]
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))


def solve():
    n = ini()
    a = inl()

    c4, c2 = 0, 0
    for x in a:
        if x % 4 == 0:
            c4 += 1
        elif x % 2 == 0:
            c2 += 1
    c1 = n - c2 - c4

    if c4 == 0:
        return c1 == 0 and c2 >= 2
    return c4 >= c1 or (c4 + 1 == c1 and c2 == 0)


print("Yes" if solve() else "No")


n = int(input())
a_ls = list(map(int, input().split()))
n_4k = 0
n_2k = 0
n_odd = 0
for i in range(n):
    if a_ls[i] % 4 ==0:
        n_4k += 1
    elif a_ls[i] % 2 ==0:
        n_2k += 1
    else:
        n_odd += 1
res = 'No'
if n_odd == 0:
    res = 'Yes'
else:
    if n_2k > 0:
        if n_odd <= n_4k:
            res = 'Yes'
    else:
        if n_odd <= n_4k+1:
            res = 'Yes'
print(res)

n=int(input()) 
c=list(map(int, input().split()))
a = 0
a2 = 0
a4 = 0

for i in c:
    if i%2 != 0:
        a += 1
    if i%2 == 0 and i%4 != 0:
        a2 += 1
    if i%4 == 0:
        a4 += 1
if a == 0 :
    print('Yes')
if a > 0 and a2 == 0:
    if a <= a4 +1 :
        print('Yes')
    else:
        print('No')
if a > 0 and a2 > 0:
    if a <= a4 :
        print('Yes')
    else:
        print('No')

n = int(input())
a = list(map(int, input().split()))
c_ki = 0
c_4 = 0
c_2 = 0
for i in range(n):
  if a[i] % 2 == 1:
    c_ki += 1
  elif a[i] % 4 == 0:
    c_4 += 1
  else:
    c_2 += 1
if c_ki <= c_4:
  print("Yes")
elif c_ki-1 == c_4 and c_2 == 0:
  print("Yes")
else:
  print("No")

N = int(input())
a = [int(x) for x in input().split()]
cnt4 = 0
cnt2 = 0
for x in a:
    if x % 4 == 0:
        cnt4 += 1
        continue
    if x % 2 == 0:
        cnt2 += 1
cnt2 = cnt2//2*2
if N-cnt2 > 2*cnt4+1:
    print('No')
else:
    print('Yes')

n=int(input())
a=list(map(int,input().split()))
b,c,d=0,0,0
for i in a:
    if i%4==0:
        b+=1
    elif i%2==0:
        c+=1
    else:
        d+=1
if c==0 and b>=d-1:
    print("Yes")
elif b>=d:
    print("Yes")
else:
    print("No")

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

multi_4 = 0
multi_2 = 0
odd = 0
for a in A:
    if a % 4 == 0:
        multi_4 += 1
    elif a % 2 == 0:
        multi_2 += 1
    else:
        odd += 1

if multi_2 > 0:
    if odd > multi_4:
        print('No')
    else:
        print('Yes')
else:
    if odd > multi_4 + 1:
        print('No')
    else:
        print('Yes')


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

two = 0
four = 0
odd = 0

for a in A:
  if a % 4 == 0:
    four += 1
  elif a % 2 == 0:
    two += 1

N -= max(0, two - 1)

print("Yes" if four >= N // 2 else "No")

import sys

n=int(input())
a=[int(x) for x in input().rstrip().split()]

even=0
odd=0
num4=0
for i in a:
  if i%4==0:
    num4+=1
    continue

  elif i%2==0:
    even+=1
  else:
    odd+=1


if odd<=num4:
  print("Yes")
elif odd-1==num4 and even==0:
  print("Yes")
elif odd==0 and 2<=even:
  print("Yes")
else:
  print("No")

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

codd = 0
cfour = 0

for i in range(n):
	if a[i]%2 != 0:
		codd += 1
	if a[i]%4 == 0:
		cfour += 1
ceven = n - cfour - codd

if cfour >= codd:
	print('Yes')
elif ceven == 0 and cfour + 1 == codd:
	print('Yes')
else:
	print('No')

import numpy as np
 
N=int(input())
A=np.array(list(map(int,input().split())))
 
odd=np.count_nonzero(A%2!=0)
four=np.count_nonzero(A%4==0)
ans='No'

if odd==1 and four>=1:
  ans='Yes'
elif odd==2 and four>=2:
  ans='Yes'
else:
  if odd+four==N and odd-1<=four:
    ans='Yes'
  elif odd<=four:
    ans='Yes'
print(ans)

with open(0) as f:
    N, *a = list(map(int, f.read().split()))
i, j, k = 0, 0, 0
for x in a:
    if x%4 == 0:
        i += 1
    elif x%2 == 0:
        j += 1
    else:
        k += 1
    
if j > 0:
    k += 1
print(('Yes' if k <= i+1 else 'No'))


import math
n = int(input())
a = list(map(int, input().split()))
c2 = 0
c4 = 0
for i in a:
    if i%4==0:
        c4+=1
    elif i%2==0:
        c2+=1

if c2 == len(a):
    print('Yes')
elif c2 >= 2:
    if c4 >= (math.ceil((len(a)-c2)/2)):
        print('Yes')
    else:
        print('No')
elif c4 >=(len(a)//2):
    print('Yes')
else:
    print('No')

n=int(input())
l=list(map(int,input().split()))
x,y,z=0,0,0
for a in l:
    if a%4==0:
        z+=1
    elif a%2==0:
        y+=1
    else:
        x+=1
if y>0:
    x+=1
print(('Yes'if x<=z+1 else'No'))


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

x = 0
y = 0
z = 0
for i in a:
  if i%4 == 0: x += 1
  elif i%2 == 0: y += 1
  else: z += 1

if y%2+z-1 <= x: print("Yes")
else: print("No")

n=int(input())
a=list(map(int,input().split()))
c2=0
c4=0
for aa in a:
  if aa%2 == 0:
    if aa%4 == 0:
      c4+=1
    else:
      c2+=1
c0=n-(c2+c4)
cc=c4-c0
if c2>=1 and c2 != n:
  cc-=1
print(("Yes" if cc >= -1 else "No"))


n = int(input())
a = list(map(int, input().split()))
a4 = []
a2 = []
a1 = []
for i in range(n):
    if a[i] % 4 == 0:
        a4.append(a[i])
    elif a[i] % 2 == 0:
        a2.append(a[i])
    else:
        a1.append(a[i])
if len(a4) >= n//2:
    print("Yes")
elif len(a4) + len(a2)//2 >= n//2:
    print("Yes")
else:
    print("No")

def main():
    n = int(input())
    a = [int(an) for an in input().split()]
    exist2 = False
    not4 = 0
    count4 = 0
    for an in a:
        if an % 2 == 0:
            if an % 4 == 0:
                count4 += 1
            else:
                if not exist2:
                    exist2 = True
                    not4 += 1
        else:
            not4 += 1
    print(('Yes' if count4 >= not4 - 1 else 'No'))


def __starting_point():
    main()

__starting_point()

N = int(input())
A = list(map(int, input().split()))
mod0 = 0
mod2 = 0
mod13 = 0

for a in A:
  mod = a % 4
  if mod == 0:
    mod0 += 1
  elif mod == 2:
    mod2 += 1
  else:
    mod13 += 1
    
if mod2 > 0:
  if mod13 <= mod0:
    print('Yes')
  else:
    print('No')
else:
  if mod13-1 <= mod0:
    print('Yes')
  else:
    print('No')

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

even=0
odd=0
four=0
for n in range(N):
    if a[n]%4==0:
        four+=1
    elif a[n]%2==0:
        even+=1
    else:
        odd+=1

if odd==0:
    print("Yes")
else:
    if even==0:
        if four>=odd-1:
            print("Yes")
        else:
            print("No")
    else:
        if four>=odd:
            print("Yes")
        else:
            print("No")

n = int(input())
a_list = list(map(int, input().split()))

x = y = z = 0
for a in a_list:
    if a % 4 == 0:
        x += 1
    elif a % 2 == 0:
        y += 1
    else:
        z += 1
if (y == 0 and x >= z - 1) or (y > 0 and x >= z):
    print("Yes")
else:
    print("No")

input();a,b,c,d,r=list(map(int,input().split())),0,0,0,'NYoe s'
for i in a:
  if i%2!=0: b+=1
  elif i%4==0: c+=1
  else: d+=1
print([r[b<=c::2],r[b<=c+1::2]][not d])

input();a,b1,b2,b4,r=list(map(int,input().split())),0,0,0,'NYoe s'
for i in a:
  if i%2!=0: b1+=1
  elif i%4==0: b4+=1
  else: b2+=1
print([r[b1<=b4::2],r[b1<=b4+1::2]][not b2])

n = int(input())

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

odd_num = len([e for e in arr if e % 2 != 0])
four_num = len([e for e in arr if e % 4 == 0])
even_num = n - odd_num - four_num

if even_num:
    print("Yes" if four_num >= odd_num else "No")
else:
    print("Yes" if four_num >= odd_num - 1 else "No")

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

x,y,z = 0,0,0
for i in a:
  if i%4 == 0: x += 1
  elif i%2 == 0: y += 1
  else: z += 1
    
if x >= z-1+y%2: print("Yes")
else: print("No")

n = int(input())
A = list(map(int, input().split()))
d, q, x = 0, 0, 0
for a in A:
    if a % 4 == 0:
        q += 1
    elif a % 2 == 0:
        d += 1
    else:
        x += 1
x += d % 2
d -= d % 2
if q+1 >= x:
    print('Yes')
else:
    print('No')
# print(d,q,x)


n=int(input())

L=list(map(int,input().split()))
a=0
b=0

for i in range(n):
	if L[i]%4==0:
		b+=1
	if L[i]%2==1:
		a+=1

if a+b==n and a-b==1:
	print('Yes')
	return
if b>=a:
	print('Yes')
else:
	print('No')

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

i1=len([i for i in A if i%2!=0])
i4=len([i for i in A if i%4==0])
i2=min(1,N-i1-i4)

# print(i1,i2,i4)
print('Yes' if (i1+i2-1)<=i4 else 'No')

N = int(input())
A = list(map(int, input().split()))
cnt_odd = 0
cnt_4 = 0
for a in A:
    if a % 2 != 0:
        cnt_odd += 1
    elif a % 4 == 0:
        cnt_4 += 1
if cnt_odd + cnt_4 == N and cnt_odd -1 == cnt_4:
    print('Yes')
else:
    print(('Yes' if cnt_4 >= cnt_odd else 'No'))


_ = input()
a = [int(x) for x in input().split()]

odd, m4, m2 = 0, 0, 0
for i in a:
    if i % 2 != 0:
        odd += 1
    elif i % 4 == 0:
        m4 += 1
    else:
        m2 = 1
else:
    if odd + m2 - 1 <= m4:
        print("Yes")
    else:
        print("No")

N = int(input())
a = list(map(int,input().split()))
c2 = 0
c4 = 0
for i in range(N):
    if a[i]%4 == 0:
        c4 += 1
    elif a[i]%2 == 0:
        c2 += 1
f = c4 * 2 + 1
if f >= N or f + c2 - 1 >= N:
    print("Yes")
else:
    print("No")

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

cnt4 = 0
cnt2 = 0
for i in a:
    if i % 4 == 0:
        cnt4 += 1
    elif i % 2 == 0:
        cnt2 += 1

if cnt4 >= n//2:
    print('Yes')
elif 2 * cnt4 >= n - cnt2:
    print('Yes')
else:
    print('No')

# -*- coding: utf-8 -*-
"""
Created on Sun Sep 27 02:20:18 2020

@author: liang
"""

N = int(input())
A = [int(x) for x in input().split()]

c0 = 0
c4 = 0
for a in A:
    if a%2 == 1:
        c0 += 1
    elif a%4 == 0:
        c4 += 1

if c0 <= c4:
    print("Yes")
else:
    if c0 + c4 == N and c0 == c4 + 1:
        print("Yes")
    else:
        print("No")

n = int(input())
li = list(map(int,input().split()))
lis = []
x = 0
y = 0
z = 0
for i in range(n):
    if li[i] % 4 == 0:
        x += 1
    elif li[i] % 2 == 0:
        y = 1
    else:
        z += 1
if y == 0:
    if x + 1 >= z:
        print("Yes")
    else:
        print("No")
else:
    if x >= z:
        print("Yes")
    else:
        print("No")

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

other, two, four = (0, 0, 0)
for a in A:
  if a%4 == 0:
    four += 1
  elif a%2 == 0:
    two += 1
  else:
    other += 1
    
ans = "No"
if other <= four:
  ans = "Yes"
elif other-four == 1 and two == 0:
  ans = "Yes"
  
print(ans)


input();a=list(map(int,input().split()))
b1,b2,b4=[],[],[];ans=''
for i in a:
  if i%2!=0:
    b1.append(i)
  elif i%4==0:
    b4.append(i)
  elif i%2==0:
    b2.append(i)
if b2:
  if len(b1)<=len(b4):
    ans='Yes'
  else:
    ans='No'
else:
  if len(b1)<=len(b4)+1:
    ans='Yes'
  else:
    ans='No'
print(ans)

import collections
_ = input()
A = collections.Counter(int(T) for T in input().split()).most_common()
Num4 = sum(A[T][1] for T in range(0,len(A)) if A[T][0]%4==0)
Num2 = sum(A[T][1] for T in range(0,len(A)) if A[T][0]%4!=0 and A[T][0]%2==0)
Odd  = sum(A[T][1] for T in range(0,len(A)) if A[T][0]%2!=0)
if Num2>0: Capacity = Num4
else: Capacity = Num4+1
if Capacity>=Odd: print('Yes')
else: print('No')

N = int(input())
lsa = list(map(int,input().split()))
ans = 'Yes'
i4 = 0
i2 = 0
i1 = 0
for i in range(N):
    if lsa[i] % 4 == 0:
        i4 += 1
    elif lsa[i] % 2 == 0:
        i2 += 1
    else:
        i1 += 1
if i4+1 < i1:
    ans = 'No'
elif i2%2 == 1 and i4+1 == i1:
    ans = 'No'
print(ans)

input();a,b1,b2,b4=list(map(int,input().split())),0,0,0
for i in a:
  if i%2!=0: b1+=1
  elif i%4==0: b4+=1
  else: b2+=1
print(['NYoe s'[b1<=b4::2],'NYoe s'[b1<=b4+1::2]][not b2])

input();a,b1,b2,b4=list(map(int,input().split())),0,0,0
for i in a:
  if i%2!=0: b1+=1
  elif i%4==0: b4+=1
  else: b2+=1
print('Yes'if b1<=b4 else'No'if b2 else'Yes'if b1<=b4+1 else'No')

n = int(input())
a_list = [int(x) for x in input().split()]
x = y = z = 0
for a in a_list:
    if a % 4 == 0:
        x += 1
    elif a % 2 == 0:
        y += 1
    else:
        z += 1
print("Yes" if (y == 0 and x >= z - 1) or (y > 0 and x >= z) else "No")

import sys
input = sys.stdin.readline

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

n_c4 = 0
n_c2 = 0
n_c0 = 0

for ai in a:
    if ai%4 ==0:
        n_c4 += 1
    elif ai%2 ==0:
        n_c2 += 1
    else:
        n_c0 += 1
if n_c4>=n_c0 or (n_c4 == n_c0-1 and n_c4+n_c0 == N) :
    print('Yes')
else:
    print('No')


N = int(input())
a = [int(i) for i in input().split()]

ki = 0
gu_2 = 0
gu_4 = 0

for i in a:
    if i % 4 == 0:
        gu_4 += 1
    elif i % 2 == 0:
        gu_2 += 1
    else:
        ki += 1

if ki <= gu_4:
    print('Yes')
else:
    if gu_4 + 1 == ki and gu_4 + ki == N:
        print('Yes')
    else:
        print('No')

n = int(input())
a = list(map(int,input().split()))
li = [0,0,0]
for i in range(n):
    if a[i]%4==0:
        li[2] +=1
        continue
    elif a[i]%2==0:
        li[1] +=1
    else:
        li[0] +=1
#print(li)

if li[0]==0:
    print("Yes")
elif li[0]==1:
    if li[2]>=1:
        print("Yes")
    else:
        print("No")
else:
    k = li[0]
    if n>=2*k:
        if li[2]>=k:
            print("Yes")
        else:
            print("No")
    elif n==2*k-1:
        if li[2]>=k-1:
            print("Yes")
        else:
            print("No")
    else:
        print("No")
    


# 2 2 4 1 4 1
# 1 4 1 2 2
n = int(input())
a = list(map(int,input().split()))
i2 = 0
i4 = 0
for i in range(n):
    if a[i]%4==0:
        i4 += 1
    if a[i]%2==0:
        i2 += 1

if n//2 <= i4:
    print('Yes')
else:
    tmp = n//2
    if n%2==0:
        if (tmp - i4) * 2 <= (i2 - i4):
            print('Yes')
        else:
            print('No')
    else:
        if (tmp - i4) * 2 + 1 <= (i2 - i4):
            print('Yes')
        else:
            print('No')


N = int(input())
A = list(map(int, input().split()))
cnt = [0]*3

for x in A:
  x %= 4
  if x == 0:
    cnt[2] += 1
  elif x == 2:
    cnt[1] += 1
  else:
    cnt[0] += 1

if cnt[0] <= cnt[2] or ( cnt[1] == 0 and cnt[0] == cnt[2] + 1):
  print("Yes")
else:
  print("No")

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

num4 = 0
num2 = 0
for i in range(n):
    if a[i]%4 == 0:
        num4 += 1
    elif a[i]%2 == 0:
        num2 += 1

#print(num4, num2)



if n-num4*2 <= 1:
    print("Yes")
elif n-num4*2 <= num2:
    print("Yes")
else:
    print("No")


n = int(input())
a = list(map(int, input().split()))
bai4 = []
bai2 = []
bai_ = []
for ai in a:
    if ai % 4 == 0:
        bai4.append(ai)
    elif ai % 2 == 0:
        bai2.append(ai)
    else:
        bai_.append(ai)

len_bai_ = len(bai_)
len_bai2 = len(bai2)
len_bai4 = len(bai4)


if len_bai_ > len_bai4:
    if len_bai_ == len_bai4 + 1 and n == len_bai_ + len_bai4:
        print("Yes")
    else:
        print("No")
else:
    print("Yes")

N = int(input())
A = list(map(int,input().split()))
X = [0,0,0]

for i in range(len(A)):
  if A[i]%4 == 0:
    X[2] += 1
  elif A[i]%2 == 0:
    X[1] += 1
  else:
    X[0] += 1

if 2*X[2] + 1 >= N:
  print("Yes")
elif 2*X[2] + X[1]>= N:
  print("Yes")
else:
  print("No")