qyliang/CodeNanoFix huggingface dataset:
# Buggy code:
n = int(input())
l = list(map(int,input().split()))
l.sort(reverse=True)
a = 0
b = 0
check = -1
for i in range(n-1):
  if l[i]==l[i+1]:
    if check != i:
      if a == 0:
        a = l[i]
        check = i+1
      else:
        b = l[i]
print(a*b)
  
  

# Fixed code:
n = int(input())
l = list(map(int,input().split()))
l.sort(reverse=True)
a = 0
b = 0
check = -1
for i in range(n-1):
  if l[i]==l[i+1]:
    if check != i:
      if a == 0:
        a = l[i]
        check = i+1
      elif b == 0:
        b = l[i]
print(a*b)
# Buggy code:
n = int(input())
a = list(map(int, input().split()))
candidate = []
for i in range(n):
    dd[str(a[i])] += 1
for k in dd.keys():
    if dd[k] >= 2:
        candidate.append(int(k))
candidate.sort(reverse=True)
if len(candidate) < 2:
    print(0)
else:
    print(candidate[0] * candidate[1])

# Fixed code:
import collections
dd = collections.defaultdict(int)
n = int(input())
a = list(map(int, input().split()))
candidate = []
for i in range(n):
    dd[str(a[i])] += 1
for k in dd.keys():
    if dd[k] >= 2:
        candidate.append(int(k))
    if dd[k] >= 4:
        candidate.append(int(k))
candidate.sort(reverse=True)
if len(candidate) < 2:
    print(0)
else:
    print(candidate[0] * candidate[1])
# Buggy code:
#Make a Rectangle
N = int(input())
A = list(map(int, input().split())

a = sorted(A, reverse=True)
b = []

i = 0
while i<N-2:
    if ( a[i]==a[i+1] ):
        b+=[a[i]]
        i+=2
    else:
        i+=1
    if (len(b)>=2):
        break

if (len(b)<2):
    print(0)
else:
    print(b[0]*b[1])

# Fixed code:
#Make a Rectangle
N = int(input())
A = list(map(int, input().split()))

a = sorted(A, reverse=True)
b = []

i = 0
while i<N-1:
    if ( a[i]==a[i+1] ):
        b+=[a[i]]
        i+=2
    else:
        i+=1
    if (len(b)>1):
        break

if (len(b)<2):
    print(0)
else:
    print(b[0]*b[1])
# Buggy code:
n = int(input())
vals = list(map(int, input().split()))
d= {}
a = [0, 0]

for i in range(n):
    if(vals[i] in d.keys()):
        d[vals[i]] += 1
    else:
        d[vals[i]] = 1

print(d)

for i in d.keys():
    if(d[i] >= 2):
        a.append(i)
a.sort()

print(a[-1]*a[-2])

# Fixed code:
n = int(input())
vals = list(map(int, input().split()))
d= {}
a = [0, 0]

for i in range(n):
    if(vals[i] in d.keys()):
        d[vals[i]] += 1
    else:
        d[vals[i]] = 1


for i in d.keys():
    if(d[i] >= 4):
        a.append(i)
        a.append(i)
    elif(d[i] >= 2):
        a.append(i)
a.sort()

print(a[-1]*a[-2])
# Buggy code:
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
INF = 10**9
mod = 10**9+7

N = i()
A = l()
A.sort(reverse=True)
list = []
start = 0
while start < N:
    if A[start] == A[start+1]:
        list.append(A[start])
        start += 2
    else:
        start += 1
if len(list) >= 2:
    print(list[0]*list[1])
else:
    print(0)

# Fixed code:
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
INF = 10**9
mod = 10**9+7

N = i()
A = l()
A.sort(reverse=True)
list = []
start = 0
while start < N-1: 
    if A[start] == A[start+1]:
        list.append(A[start])
        start += 2
    else:
        if start == N-2:
            break
        start += 1
if len(list) >= 2:
    print(list[0]*list[1])
else:
    print(0)
# Buggy code:
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] + X[1] >= N:
  print("Yes")
else:
  print("No")

# Fixed code:
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")
# Buggy code:
import sys
bbn=1000000007
	
#+++++
		
def main():
	n = int(input())
	al = list(map(int, input().split()))
	
	b4=0
	odd=0
	for v in al:
		if v % 4 == 0:
			b4+=1
		elif v % 2 == 1:
			odd+=1
	ret = 'Yes' if b4 >= odd else 'No'
	print(ret)
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)

if __name__ == "__main__":
	if sys.platform =='ios':
		sys.stdin=open('inputFile.txt')
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

# Fixed code:
import sys
bbn=1000000007
	
#+++++
		
def main():
	n = int(input())
	al = list(map(int, input().split()))
	
	b4=0
	odd=0
	b2=0
	for v in al:
		if v % 4 == 0:
			b4+=1
		elif v % 2 == 1:
			odd+=1
		else:
			b2+=1
	ret = 'Yes' if (b4 + (b2==0))>= odd else 'No'
	print(ret)
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)

if __name__ == "__main__":
	if sys.platform =='ios':
		sys.stdin=open('inputFile.txt')
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)
# Buggy code:
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 + two // 3 >= n // 2:
    print("Yes")
else:
    print("No")


# Fixed code:
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")
# Buggy code:
from sys import stdin
N = int(stdin.readline().rstrip())
a = [int(x) for x in stdin.readline().rstrip().split()]
v1 = 0
v2 = 0
v4 = 0
for i in a:
    if i % 4 == 0:
        v4 += 1
    elif i % 2 == 0:
        v2 += 1
    else:
        v1 += 1

if (v4 >= v1) and (v2 >= 2):
    print("Yes")
else:
    print("No")


# Fixed code:
from sys import stdin
N = int(stdin.readline().rstrip())
a = [int(x) for x in stdin.readline().rstrip().split()]
v1 = 0
v2 = 0
v4 = 0
for i in a:
    if i % 4 == 0:
        v4 += 1
    elif i % 2 == 0:
        v2 += 1
    else:
        v1 += 1
#print(v4,v2,v1)
if v4 >= (v1 + v2 - 1):
    print("Yes")
else:
    if (v4 >= v1) and (v2 >= 2):
      print("Yes")
    else:
      print("No")
# Buggy code:
import collections as col


def convert(x):
    if x % 4 == 0:
        return 4
    elif x % 2 == 0:
        return 2
    else:
        return 1

if __name__ == "__main__":
    n = int(input())
    a = map(int, input().split())

    count = col.Counter(map(convert, a))

    if count[4] >= count[1]:
        print('Yes')
    elif count[1] == count[4] + 1 and count[2]:
        print('Yes')
    else:
        print('No')


# Fixed code:
import collections as col


def convert(x):
    if x % 4 == 0:
        return 4
    elif x % 2 == 0:
        return 2
    else:
        return 1


if __name__ == "__main__":
    n = int(input())
    a = map(int, input().split())

    count = col.Counter(map(convert, a))

    if count[1] >= 1:
        if count[4] >= count[1]:
            print('Yes')
        elif count[1] == count[4] + 1 and count[2] == 0:
            print('Yes')
        else:
            print('No')

    else:  # count[1] == 0
        if count[4] >= 1:
            print('Yes')
        elif count[2] >= 2:
            print('Yes')
        else:
            print('No')
# Buggy code:
def main():
    N = int(input())
    A = list(map(int, input().split(' ')))
    c_4, c_2, c_0 = 0, 0, 0
    for a in A:
        if a % 4 == 0:
            c_4 += 1
        elif a % 2 == 0:
            c_2 += 1
        else:
            c_0 += 1
    print('Yes' if c_4 >= c_0 else 'No')


if __name__ == '__main__':
    main()


# Fixed code:
def main():
    N = int(input())
    A = list(map(int, input().split(' ')))
    c_4, c_2, c_0 = 0, 0, 0
    for a in A:
        if a % 4 == 0:
            c_4 += 1
        elif a % 2 == 0:
            c_2 += 1
        else:
            c_0 += 1
    if c_2 == N:
        print('Yes')
    elif 0 < c_2 < N:
        print('Yes' if c_4 > 0 and c_4 >= c_0 else 'No')
    else:
        print('Yes' if c_4 >= c_0 - 1 else 'No')


if __name__ == '__main__':
    main()
# Buggy code:
n = int(input())
lst = [int(i) for i in input().split()]

b1 = 0
b2 = 0
b4 = 0

for i in range(n):
    if lst[i] % 2 != 0:
        b1 += 1
    elif lst[i] % 4 == 0:
        b4 += 1
    else:
        b2 += 1

flg = True
if b2 == 0:
    if b1 > b4 + 1:
        flg = False
else:
    if b1 > b4:
        fla = False

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

# Fixed code:
n = int(input())
lst = [int(i) for i in input().split()]

b1 = 0
b2 = 0
b4 = 0

for i in range(n):
    if lst[i] % 2 != 0:
        b1 += 1
    elif lst[i] % 4 == 0:
        b4 += 1
    else:
        b2 += 1

flg = True
if b2 == 0:
    if b1 > b4 + 1:
        flg = False
else:
    if b1 > b4:
        flg = False

if flg:
    print('Yes')
else:
    print('No')
# Buggy code:
N = input()
A = list(map(int, input().split()))
odd, four = 0, 0, 0
for i in range(N):
  if A[i] % 4 == 0:
    four += 1
  else:
    if A[i] % 2 == 1:
      odd += 1
if four < odd and four + odd < N:
  print('No')
else:
  print('Yes')


# Fixed code:
N = int(input())
A = list(map(int, input().split()))
odd, four = 0, 0
for i in range(N):
  if A[i] % 4 == 0:
    four += 1
  else:
    if A[i] % 2 == 1:
      odd += 1
if four < odd and four + odd < N:
  print('No')
elif odd - four > 1 and four + odd == N:
  print('No')
else:
  print('Yes')
# Buggy code:
N=int(input());A=input().split();v=[int(i)%4 for i in A];print('Yes' if v.count(0)*2+v.count(2)>=N else 'No')

# Fixed code:
N=int(input());A=input().split();v=[int(i)%4 for i in A];print('Yes' if v.count(0)+v.count(2)//2>=N//2 else 'No')
# Buggy code:
n = int(input())
a = list(map(int, input().split()))
f = 0
t = 0
k = 0
for i in a:
    if i % 4 == 0:
        f += 1
    elif i % 2 == 0:
        t += 1
    else:
        k += 1


if t > 0:
    if f >= k:
        print("Yes")
    else:
        print("No")
else:
    if f >= k + 1:
        print("Yes")
    else:
        print("No")


# Fixed code:
n = int(input())
a = list(map(int, input().split()))
f = 0
t = 0
k = 0
for i in a:
    if i % 4 == 0:
        f += 1
    elif i % 2 == 0:
        t += 1
    else:
        k += 1

if t > 0:
    if f >= k:
        print("Yes")
    else:
        print("No")
else:
    if f + 1 >= k:
        print("Yes")
    else:
        print("No")
# Buggy code:
n = int(input())
a = list(map(int, input().split()))
o = 0
f = 0
for i in a:
    if i % 4 == 0:
        f += 1
    elif i % 2 == 1:
        o += 1
print("Yes" if f >= o - 1 else "No")

# Fixed code:
n = int(input())
a = list(map(int, input().split()))
o = 0
t = 0
f = 0
for i in a:
    if i % 4 == 0:
        f += 1
    elif i % 2 == 0:
        t += 1
    else:
        o += 1
if t > 0:
    print("Yes" if f >= o else "No")
else:
    print("Yes" if f >= o - 1 else "No")
# Buggy code:
n = int(input())
num = [ int(v) for v in input().split() ]
a, b, c = 0, 0, 0
for i in num:
	if i % 2 != 0:
		a += 1
	elif i % 4 != 0:
		b += 1
	else:
		c += 1
print(a,c)
if c >= a - 1:
	print("Yes")
else:
	print("No")

# Fixed code:
n = int(input())
num = [ int(v) for v in input().split() ]
a, b, c = 0, 0, 0
for i in num:
	if i % 2 != 0:
		a += 1
	elif i % 4 != 0:
		b += 1
	else:
		c += 1
if b == 0:
	if c >= a - 1:
		print("Yes")
	else:
		print("No")
else:
	if c >= a:
		print("Yes")
	else:
		print("No")
# Buggy code:
N = int(input())
a = list(map(int,input().rstrip().split(" ")))
counter = [0,0,0]
for i in a:
    if i % 4 == 0:
        counter[2] += 1
    elif i % 2 == 0:
        counter[1] += 1
    else:
        counter[0] += 1
if (counter[1] - 1) + counter[2] * 1 >= counter[0]:
    print("Yes")
else:
    print("No")

# Fixed code:
N = int(input())
a = list(map(int,input().rstrip().split(" ")))
counter = [0,0,0]
for i in a:
    if i % 4 == 0:
        counter[2] += 1
    elif i % 2 == 0:
        counter[1] += 1
    else:
        counter[0] += 1
counter[0] += min(1,counter[1])

if counter[2] + 1 >= counter[0]:
    print("Yes")
else:
    print("No")
# Buggy code:
import math
N = int(input())
A = list(map(int,input().split()))
l = list()
ll = list()
for i in range(len(A)):
  if A[i]%4 == 0:
    l.append(A[i])
  if A[i]%2 == 0:
    ll.append(A[i])
four = len(l)
two = len(ll)-four
zero = N-two
a = math.floor(N/2)
if a <= four and b == 0:
  print("Yes")
elif a-two <= four:
  print("Yes")
else:
  print("No")

# Fixed code:
import math
N = int(input())
A = list(map(int,input().split()))
l = list()
ll = list()
for i in range(len(A)):
  if A[i]%4 == 0:
    l.append(A[i])
  if A[i]%2 == 0:
    ll.append(A[i])
four = len(l)
two = len(ll)-four
zero = N-two
a = math.floor(N/2)
if a <= four:
  print("Yes")
elif a-two/2 <= four:
  print("Yes")
else:
  print("No")
# Buggy code:
n = int(input())
a = list(map(int, input().split()))
num_2 = 0
num_4 = 0
for i in a:
    if i % 4 == 0:
        num_4 += 1
        num_2 += 1
    elif i % 2 == 0:
        num_2 += 1
x = num_4 * 2
if num_4 >= n // 2:
    print("Yes")
elif num_2 >= n - x:
    print("Yes")
else:
    print("No")

# Fixed code:
n = int(input())
a = list(map(int, input().split()))
num_2 = 0
num_4 = 0
for i in a:
    if i % 4 == 0:
        num_4 += 1
    elif i % 2 == 0:
        num_2 += 1
x = num_4 * 2
if num_4 >= n // 2:
    print("Yes")
elif num_2 >= n - x:
    print("Yes")
else:
    print("No")
# Buggy code:
n = int(input())
a = list(map(int, input().split()))
k = 0
g = 0
for i in a:
  if(i%4 == 0):g+=1
  if(i%2 == 1):k+=1
#print(g,k)
if(g>=k):print("Yes")
else:print("No")

# Fixed code:
n = int(input())
a = list(map(int, input().split()))
k = 0
g = 0
for i in a:
  if(i%4 == 0):g+=1
  if(i%2 == 1):k+=1
#print(g,k)
if(g>=k or (g+1>=k and g+k==n)):print("Yes")
else:print("No")
# Buggy code:
import sys
input = sys.stdin.readline

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N=I()
    a=LI()
    tw=0
    fo=0
    for i in range(N):
        if a[i]%4==0:
            fo+=1
        elif a[i]%2==0:
            tw+=1
            
    N2=N-tw
    if N2//2<=fo:
        print("Yes")
    else:
        print("No")

main()



# Fixed code:
import sys
input = sys.stdin.readline

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N=I()
    a=LI()
    tw=0
    fo=0
    for i in range(N):
        if a[i]%4==0:
            fo+=1
        elif a[i]%2==0:
            tw+=1
    if tw>=1:
        tw-=1
     
    N2=N-tw
    if N2//2<=fo:
        print("Yes")
    else:
        print("No")

main()
# Buggy code:
# -*- coding: utf-8 -*-

def main(N,A):
    count4 = count2 = count = 0
    for a in A:
        if(a%4==0):
            count4 += 1
        elif(a%2==0):
            count2 += 1
        else:
            count += 1
            
    if(count-1<=count4 and count2!=1):
        print("Yes")
    else:
        print("No")
    
            
if __name__ == '__main__':
    N = int(input())
    A = [int(a) for a in input().split()]
    main(N,A)

# Fixed code:
# -*- coding: utf-8 -*-

def main(N,A):
    count4 = count2 = count = 0
    for a in A:
        if(a%4==0):
            count4 += 1
        elif(a%2==0):
            count2 += 1
        else:
            count += 1
            
    if(count2==0):
        if(count-1<=count4):
            print("Yes")
        else:
            print("No")
    else:
        if(count<=count4):
            print("Yes")
        else:
            print("No")
            
if __name__ == '__main__':
    N = int(input())
    A = [int(a) for a in input().split()]
    main(N,A)
# Buggy code:
n = int(input())
a = list(map(int, input().split()))
d = {1:0, 2:0, 4:0}
for i in a:
  if i % 4 == 0:
    d[4] += 1
  elif i % 2 == 0:
    d[2] += 1
  else:
    d[1] += 1
print(d)
if (d[2] >= 1 and d[1] <= d[4]) or d[1]-1 <= d[4]:
  print("Yes")
else:
  print("No")


# Fixed code:
n = int(input())
a = list(map(int, input().split()))

d = {2:0, 4:0, 1:0}

for i in a:
  if i % 4 == 0:
    d[4] += 1
  elif i % 2 == 0:
    d[2] += 1
  else:
    d[1] += 1

d[2] = d[2] % 2

if d[2] == 0:
  if d[1] - 1 <= d[4]:
    print("Yes")
  else:
    print("No")
else:
  if d[1] <= d[4]:
    print("Yes")
  else:
    print("No")
# Buggy code:
n= int(input())

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

k = len(filter(lambda(x, x%4), a))
j = len(filter(lambda(x, x%2), a))-k
i = len(a)-j-k

if (j > 0) and (i+1 <= k):
    print("Yes")
if (j == 0) and (i-1 <= k):
    print("Yes")
else:
    print("No")


# Fixed code:
n= int(input())

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

k = len(list(filter(lambda x: x%4 == 0, a)))
j = len(list(filter(lambda x: x%2 == 0, a)))-k
i = len(a)-j-k

if (j > 0) and (i <= k):
    print("Yes")
elif (j == 0) and (i-1 <= k):
    print("Yes")
else:
    print("No")
# Buggy code:
n=int(input())
c2=0
c4=0
for a in map(int,input().split()):
	if a%4==0:c4+=1
	elif a%2==0:c2+=1
n-=c2
print('Yes' if c4>=n//2 else 'No')
	

# Fixed code:
n=int(input())
c2=0
c4=0
for a in map(int,input().split()):
	if a%4==0:c4+=1
	elif a%2==0:c2+=1
if c2>1:n-=c2-1
print('Yes' if c4>=n//2 else 'No')
# Buggy code:
def main():
  n=int(input())
  a=tuple(map(int,input().split()))
  cnt2,cnt4=0,0
  for i in a:
    cnt2+=1 if i%2==0 and i%4>0 else 0
    cnt4+=1 if i%4==0 else 0
  print('Yes' if (n-cnt2)/2<=cnt4 else 'No')
if __name__=='__main__':
  main()

# Fixed code:
def main():
  n=int(input())
  a=tuple(map(int,input().split()))
  cnt2,cnt4=0,0
  for i in a:
    cnt2+=1 if i%2==0 and i%4>0 else 0
    cnt4+=1 if i%4==0 else 0
  print('Yes' if (cnt2>=2 and cnt4>=(n-cnt2)/2) or (cnt2<2 and cnt4>=n//2) else 'No')
if __name__=='__main__':
  main()
# Buggy code:
n = int(input())
a = list(map(int, input().split()))
fCount = 0
tCount = 0

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

# ans = n - fCount * 3 - (tCount // 2) * 2
ans = n - fCount * 3 - tCount

if ans > 0:
    print('No')
else:
    print('Yes')




# Fixed code:
n = int(input())
a = list(map(int, input().split()))
fCount = 0
tCount = 0
oCount = 0

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

ans = 0
# ans = n - fCount * 3 - (tCount // 2) * 2
#print(fCount, tCount)

if tCount > 1:
    if fCount > 0:
        if oCount >= fCount:
            ans = n - (2 * fCount + 1) - tCount + 1
        else:
            #print(2 * fCount + 1 + tCount)
            ans = n - (2 * fCount + 1) - tCount
    else:
        ans = n - tCount
else:
    if fCount > 0:
        ans = n - (2 * fCount + 1)
    else:
        ans = n

#print(ans)

if ans > 0:
    print('No')
else:
    print('Yes')
# Buggy code:
n = int(input())
l = list(map(int,input().split()))
c = len([i for i in l if i%4==0])
l1 = [i for i in l if not (i%2==0 and i%4!=0)]
if len(l1)>=1:
  a = n-len(l1)+1
  a = a-c
  if a<=c-1:
    print("Yes")
  else:
    print("No")
else:
  if a<=c-1:
    print("Yes")
  else:
    print("No")

# Fixed code:
n = int(input())
l = list(map(int,input().split()))
c = len([i for i in l if i%4==0])
l1 = [i for i in l if  (i%2==0 and i%4!=0)]
if len(l1)>=1:
  a = n-len(l1)+1
  a = a-c
  if a<=c+1:
    print("Yes")
  else:
    print("No")
else:
  a = n-c
  if a<=c+1:
    print("Yes")
  else:
    print("No")
# Buggy code:
n, *a = map(int, open(0).read().split())
s = [i%4 for i in a]
f, k = s.count(0), s.count(2)
print("YNeos"[n-f-k > f+(k>0)::2])

# Fixed code:
n, *a = map(int, open(0).read().split())
s = [i%4 for i in a]
f, t = s.count(0), s.count(2)
print("YNeos"[n-f-t+(t>0) > f+1::2])
# Buggy code:
import math
N = input()
A = list(map(int, input().split()))

f,e,d = 0,0,0

for a in A:
    x = a % 4
    if(x==0):
        f = f+1
    elif(x==2):
        e = e+1
    else:
        d = d+1
if(e>0): d = d+1
if(d <= f):
    print("Yes")
else:
    print("No")

# Fixed code:
import math
N = input()
A = list(map(int, input().split()))

f,e,d = 0,0,0

for a in A:
    x = a % 4
    if(x==0):
        f = f+1
    elif(x==2):
        e = e+1
    else:
        d = d+1
if(e>0):
    d = d+1
if(f >= d-1):
    print("Yes")
else:
    print("No")
# Buggy code:
n = int(input())
a = map(int, input().split())
num4 = 0
num1 = 0
for i in a:
    if i % 4 == 0:
        num4 += 1
        continue
    if i % 2 == 1:
        num1 += 1
if num4 >= num1:
    print("Yes")
elif num4 + 1 == num1 and (num4 + num1) % 2 == 1:
    print("Yes")
else:
    print("No")


# Fixed code:
n = int(input())
a = map(int, input().split())
num4 = 0
num1 = 0
for i in a:
    if i % 4 == 0:
        num4 += 1
        continue
    if i % 2 == 1:
        num1 += 1
if num4 >= num1:
    print("Yes")
elif num4 + 1 == num1 and (num4 + num1) % 2 == 1 and n - (num4 + num1) == 0:
    print("Yes")
else:
    print("No")
# Buggy code:
N = int(input())
a = list(map(int,input().split()))
one = 0
four = 0
two = 0

for j in range(N):

  if a[j]%2 == 1:
    one += 1
  elif a[j]%4 == 0:
    four += 1
  else :
    two +=1

  
if one <= four:
  print('Yes')
else :
  if two == 0:
    if four == one + 1:
      print('Yes')
  else:
    print('No')



# Fixed code:
N = int(input())
a = list(map(int,input().split()))
one = 0
four = 0
two = 0

for j in range(N):

  if a[j]%2 == 1:
    one += 1
  elif a[j]%4 == 0:
    four += 1
  else :
    two +=1

  
if one <= four or (two == 0 and four == one -1):
  print('Yes')

else:

  print('No')
# Buggy code:
N=int(input())
a=input().split()
numbers=[int(b) for b in a]
kazu=0
suuji=0
for z in numbers:
    if z%2==0:
        kazu+=1
for y in numbers:
    if y%4==0:
        suuji+=1
if kazu==N:
    print('Yes')
elif suuji==N//2:
    print('Yes')
elif kazu>=N-kazu*3+1:
    print('Yes')
else:
    print('No')


# Fixed code:
N=int(input())
a=input().split()
numbers=[int(b) for b in a]
kazu=0
suuji=0
for z in numbers:
    if z%2==0:
        kazu+=1
for y in numbers:
    if y%4==0:
        suuji+=1
kazu-=suuji
if kazu==N:
    print('Yes')
elif suuji>=N//2:
    print('Yes')
elif kazu>=N-suuji*2:
    print('Yes')
else:
    print('No')
# Buggy code:
n=int(input())
l=list(map(int,input().split()))
count2=0
count4=0
for i in range(n):
  if l[i]%4==0:
    count4+=1
  elif l[i]%2==0:
    count2+=1
if count4*2+count2>n:
  print("Yes")
else:
  print("No")

# Fixed code:
n=int(input())
l=list(map(int,input().split()))
count2=0
count4=0
for i in range(n):
  if l[i]%4==0:
    count4+=1
  elif l[i]%2==0:
    count2+=1
if count4*2+count2>=n or count4*2+1>=n:
  print("Yes")
else:
  print("No")
# Buggy code:
n=int(input())
for i in range(n):
    if 2**i>n:
        print(2**(i-1))
        break
    

# Fixed code:
n=int(input())

for i in range(n):
    if 2**i>n:
        print(2**(i-1))
        break
    elif 2**i==n:
        print(n)
        break