ZhenlongDai/ACPR huggingface dataset:
Problem: p03637
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N = int(input())
A = list(map(int, input().split()))
odd = 0
four = 0
for i in range(0, N):
	if A[i] % 4 == 0: four += 1
	if A[i] % 2 != 0: odd += 1
if odd <= four+1: print('Yes')
else: print('No')

Failing test case input:
4
0 2 3 7

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int, input().split()))
odd = 0
four = 0
for i in range(0, N):
	if A[i] % 4 == 0: four += 1
	if A[i] % 2 != 0: odd += 1
if odd <= four+N%2: print('Yes')
else: print('No')

Problem: p03637
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))
cnt2 = 0
cnt4 = 0
for i in range(n):
    if(a[i] % 4 == 0):
        cnt4 += 1
    elif(a[i] % 2 == 0):
        cnt2 += 1

if((cnt4 * 3) >= n or cnt2 >= (n - (cnt4 * 3) + 1)):
    print("Yes")
else:
    print("No")


Failing test case input:
6
6 7 0 8 3 9

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int, input().split()))
cnt2 = 0
cnt4 = 0
for i in range(n):
    if(a[i] % 4 == 0):
        cnt4 += 1
    elif(a[i] % 2 == 0):
        cnt2 += 1

if((cnt4 * 2 + 1) >= n or cnt2 >= (n - (cnt4 * 2 + 1) + 1)):
    print("Yes")
else:
    print("No")

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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")

Failing test case input:
3
1 28 010

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
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")

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
    ans = "No"
    yon = 0
    ni = 0
    hoka = 0
    N = int(input())
    for ele in input().split():
        ele = int(ele)
        if ele == 2:
            ni += 1
        elif ele % 4 == 0:
            yon += 1

    if yon >= int(N/2):
        print("Yes")
        exit()

    tmp = int(max(min(ni/2, yon/2), 0))
    N -= 3 * tmp
    yon -= tmp

    if yon >= int(N/2):
        ans = "Yes"

    print(ans)


if __name__ == "__main__":
    main()


Failing test case input:
6
6 7 0 8 2 9

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
def main():
    N = int(input())
    ni = 0
    yon = 0
    ans = "No"
    for a in input().split():
        a = int(a)
        if a % 4 == 0:
            yon += 1
        elif a % 2 == 0:
            ni += 1

    if int(N / 2) <= yon:
        ans = "Yes"
    elif (N-2*yon) <= ni:
        ans = "Yes"

    print(ans)


if __name__ == "__main__":
    main()
Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def count_four(lst):
    counter = 0
    for i in lst:
        if i%4 == 0:
            counter += 1
    return counter

def count_two(lst):
    counter = 0
    for i in lst:
        if i%2 == 0:
            counter += 1
    return counter

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

def solve(lst):
    four = count_four(lst)
    two = count_two(lst) - four
    sonota = len(lst) - four - two







    two = 1 if two>=1 else 0
    if two == 0 and four + 1 - sonota >= 0:
        return "Yes"
    else:
        return "No"



    if four + 1 - sonota - two > 0:
        return "Yes"
    else:
        return "No"

print(solve(lst))



Failing test case input:
3
1 1 -2

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
def count_four(lst):
    counter = 0
    for i in lst:
        if i%4 == 0:
            counter += 1
    return counter

def count_two(lst):
    counter = 0
    for i in lst:
        if i%2 == 0:
            counter += 1
    return counter

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

def solve(lst):
    four = count_four(lst)
    two = count_two(lst) - four
    others = n - four - two

    if two == 0:
        if four + 1 - others >= 0:
            return "Yes"
        else:
            return "No"

    if two > 0:
        two = 1
        if four + 1 - others - two >= 0:
            return "Yes"
        else:
            return "No"


print(solve(lst))

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())

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

point = 0

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

if n % 2 == 1:
    if n <= point + 1:
        print("YES")
    else:
        print("NO")
else:
    if n <= point:
        print("YES")
    else:
        print("NO")





Failing test case input:
6
6 7 0 8 6 9

Expected output:
Yes


Actual output:
YES


Fixed submission (verdict: Accepted):
n = int(input())

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

point = 0

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

if n % 2 == 1:
    if n <= point + 1:
        print("Yes")
    else:
        print("No")
else:
    if n <= point:
        print("Yes")
    else:
        print("No")

Problem: p03637
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n, *a = map(int, open(0).read().split())
f = 0
t = 0
for i in a:
    if i % 4 == 0:
        f += 1
    elif i % 2 == 0:
        t += 1
if 2*f + t >= len(a):
    print('Yes')
    quit()
elif 2*f + t + 1 == len(a) and f != 0:
    print('Yes')
else:
    print('No')

Failing test case input:
6
5 7 0 8 6 9

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
n, *a = map(int, open(0).read().split())
f = 0
t = 0
o = 0
for i in a:
    if i % 4 == 0:
        f += 1
    elif i % 2 == 0:
        t += 1
    else:
        o += 1
if f >= o - 1 and t == 0:
    print('Yes')
elif f >= o:
    print('Yes')
else:
    print('No')
Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = list(map(int, input().split()))

num2 = 0
num4 = 0
numo = 0

for a in A:
    if a%4 == 0:
        num4 += 1
    elif a == 2:
        num2 += 1
    else:
        numo += 1

if num2 == 0:
    if num4 + 1 >= numo:
        print("Yes")
    else:
        print("No")
else:
    if num4 >= numo:
        print("Yes")
    else:
        print("No")

Failing test case input:
6
6 7 0 8 2 9

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int, input().split()))

num2 = 0
num4 = 0
numo = 0

for a in A:
    if a % 4 == 0:
        num4 += 1
    elif a % 2 == 0:
        num2 += 1
    else:
        numo += 1

if num2 == 0:
    if num4 + 1 >= numo:
        print("Yes")
    else:
        print("No")
else:
    if num4 >= numo:
        print("Yes")
    else:
        print("No")

Problem: p03637
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))
cnt2 = 0
cnt4 = 0
for i in range(n):
    if(a[i] % 4 == 0):
        cnt4 += 1
    elif(a[i] % 2 == 0):
        cnt2 += 1

if((cnt4 * 3) >= n or cnt2 >= (n - (cnt4 * 3) + (cnt4 > 0))):
    print("Yes")
else:
    print("No")


Failing test case input:
6
6 7 0 8 3 9

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int, input().split()))
cnt2 = 0
cnt4 = 0
for i in range(n):
    if(a[i] % 4 == 0):
        cnt4 += 1
    elif(a[i] % 2 == 0):
        cnt2 += 1

if((cnt4 * 2 + 1) >= n or cnt2 >= (n - (cnt4 * 2 + 1) + 1)):
    print("Yes")
else:
    print("No")

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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[-1] + d[2] <= d[4]:
  print("Yes")
else:
  print("No")

Failing test case input:
3
1 -4 -2

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
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")

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, *a_l = map(int, open(0).read().split())
multi_4 = sum([1 for a in a_l if a%4 == 0])
multi_2 = sum([1 for a in a_l if a%2 == 0]) - multi_4
print( 'Yes' if ((multi_4 * 2 + 1 ) + multi_2 - 1) >= n else 'No')


Failing test case input:
3
1 7 100

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
n, *a_l = map(int, open(0).read().split())
multi_4 = sum([1 for a in a_l if a%4 == 0])
multi_2 = sum([1 for a in a_l if a%2 == 0]) - multi_4
multi_1 = n - ( multi_2 + multi_4 )
print('Yes' if (multi_2%2 + multi_1) <= multi_4 + 1 else 'No')
Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = [int(x) for x in input().split()]

m1 = 0
m2 = 0
m4 = 0

for a in A:
	if a%4==0:
		m4 += 1
	elif a%2==0:
		m2 += 1
	else:
		m1 += 1

m1 = m1 + m2%2
if 2*m4>=m1:
	print('Yes')
else:
	print('No')

Failing test case input:
6
5 7 0 8 6 9

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
from sys import exit

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

m1 = 0
m2 = 0
m4 = 0

for a in A:
	if a%4==0:
		m4 += 1
	elif a%2==0:
		m2 += 1
	else:
		m1 += 1


m1 = m1 + (m2>0)
if m4>=m1-1:
	print('Yes')
else:
	print('No')

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(map(int,input().split()))
odd = 0
even4 = 0
for num in a:
  if num&2 == 1:
    odd += 1
  elif num%4 == 0:
    even4 += 1
if even4 >= odd:
  print('Yes')
else:
  print('No')

Failing test case input:
3
-1 1 -1

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int,input().split()))
odd = 0
even4 = 0
for num in a:
  if num%2 == 1:
    odd += 1
  elif num%4 == 0:
    even4 += 1
if odd + even4 == n and even4 >= odd-1:
  print('Yes')
elif even4 >= odd:
  print('Yes')
else:
  print('No')

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = list(map(int, input().split()))
four, odd = 0, 0
for a in A:
    if a%4 == 0:
        four += 1
    elif a%2 == 1:
        odd += 1
result = 'No' if odd > four else 'Yes'
print('result')

Failing test case input:
6
5 7 0 0 6 9

Expected output:
No


Actual output:
result


Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int, input().split()))
four, two, odd = 0, 0, 0
for a in A:
    if a%4 == 0:
        four += 1
    elif a%2 == 0:
        two += 1
    else:
        odd += 1
result = 'Yes' if four + 1 >= odd + bool(two) else 'No'
print(result)

Problem: p03637
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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:
  if x4>=x1:
    print('Yes')
  else:
    
    print('No')


Failing test case input:
3
1 1 -3

Expected output:
No


Actual output:

Fixed submission (verdict: Accepted):
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')
Problem: p03637
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
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[2] != 0): counter[1] +=1
p = (max(counter[1] - 1,0)) + (counter[2] + 1)

if p >= counter[0]:
    print("Yes")
else:
    print("No")

Failing test case input:
4
0 2 3 7

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
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")

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):






n = int(input())
a = list(map(int, input().split()))
p=0
f=0
for ai in a:
    if ai%2!=0:
        p+=1
    else:
        if ai/2%2==0:
            f+=1
if f==0:
    print('No')
elif f==1:
    if n>3:
        print('No')
    else:
        print('Yes')
elif p>f:
    if p%2==1 and 2*p-1==n:
        print('Yes')
    else:
        print('No')
else:
    print('Yes')



Failing test case input:
3
2 10 110

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int, input().split()))
p=0
f=0
for ai in a:
    if ai%2==1:
        p+=1
    else:
        if ai/2%2==0:
            f+=1
if p==0:
    print('Yes')
elif p>f:
    if n%2==1 and 2*f+1==n:
        print('Yes')
    else:
        print('No')
else:
    print('Yes')

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

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

two_count = 0
four_count = 0
for i in a:
    if i >= 4 and i % 4 == 0:
        four_count += 1
    elif i >= 2 and i % 2 == 0:
        two_count += 1

if two_count <= 1:
    if len(a) == 2:
        print("Yes" if four_count >= 1 else "No")
    else:
        print("Yes" if four_count >= len(a)-2 else "No")
else:
    check = len(a) - two_count
    if check == 0:
        print("Yes")
    elif check <= 2:
        print("Yes" if four_count >= 1 else "No")
    else:
        print("Yes" if four_count >= check-2 else "No")

Failing test case input:
3
1 -4 -2

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):

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

two_count = 0
four_count = 0
for i in a:
    if i >= 4 and i % 4 == 0:
        four_count += 1
    elif i >= 2 and i % 2 == 0:
        two_count += 1

if two_count <= 1:
    if len(a) == 2:
        print("Yes" if four_count >= 1 else "No")
    else:
        print("Yes" if four_count >= len(a)
else:
    check = len(a) - two_count
    if check == 0:
        print("Yes")
    elif check <= 2:
        print("Yes" if four_count >= 1 else "No")
    else:
        print("Yes" if four_count >= math.ceil(check/2) else "No")
Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def count_four(lst):
    counter = 0
    for i in lst:
        if i%4 == 0:
            counter += 1
    return counter

def count_two(lst):
    counter = 0
    for i in lst:
        if i%2 == 0:
            counter += 1
    return counter

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

def solve(lst):
    four = count_four(lst)
    two = count_two(lst) - four
    others = n - four - two
    if four == 0 and others == 0:
        return "Yes"
    if four == 0 and two == 0:
        return "No"




    
    four += 1
    four -= others




    if four <= 0 :
        return"No"
    else:
        return "Yes"

print(solve(lst))

Failing test case input:
3
1 0 -5

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
def count_four(lst):
    counter = 0
    for i in lst:
        if i%4 == 0:
            counter += 1
    return counter

def count_two(lst):
    counter = 0
    for i in lst:
        if i%2 == 0:
            counter += 1
    return counter

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

def solve(lst):
    four = count_four(lst)
    two = count_two(lst) - four
    others = n - four - two

    if two == 0:
        if four + 1 - others >= 0:
            return "Yes"
        else:
            return "No"

    if two > 0:
        two = 1
        if four + 1 - others - two >= 0:
            return "Yes"
        else:
            return "No"


print(solve(lst))

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
A = [int(i) for i in input().split()]

cnt2 = 0
cnt4 = 0

for i in range(n):
    if A[i] % 4 == 0:
        cnt4 += 1
    elif A[i] % 2 == 0:
        cnt2 += 1
        

if cnt4 * 2 + cnt2 + 1 >= n:
    print('Yes')
else:
    print('No')

Failing test case input:
4
0 2 3 7

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
n = int(input())
A = [int(i) for i in input().split()]


cnt2 = 0
cnt4 = 0

for i in range(n):
    if A[i] % 4 == 0:
        cnt4 += 1
    elif A[i] % 2 == 0:
        cnt2 += 1

        
if cnt4*2 + cnt2 >= n or (cnt4 * 2 + 1) >= n:
    print('Yes')
else:
    print('No')

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

xs = map(int, input().split())

n1, n4 = 0, 0

for x in xs:
    if x % 4 == 0:
         n4 += 1
    elif x % 2 == 0:
         continue
    else:
         n1 += 1


print("Yes" if n4 >= n1 - 1 else "No")








Failing test case input:
3
3 -5 -1

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):

input()
xs = map(int, input().split())

n1, n2, n4 = 0, 0, 0

for x in xs:
    if x % 4 == 0:
        n4 += 1
    elif x % 2 == 0:
        n2 += 1
    else:
        n1 += 1

if n2 == 0:
    print("Yes" if n4 >= n1 - 1 else "No")
else:
    print("Yes" if n4 >= n1 else "No")
Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))

f = 0
d = 0
for x in a:
    if x % 4 == 0:
        f += 1
    elif x % 2 == 0:
        d += 1

d -= d % 2

n -= f * 3 + d

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

Failing test case input:
6
5 7 0 0 6 9

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int, input().split()))

f = 0
d = 0
for x in a:
    if x % 4 == 0:
        f += 1
    elif x % 2 == 0:
        d += 1

if 0 < d < n:
    d -= 1

if n > f * 2 + 1 + d:
    print('No')
else:
    print('Yes')

Problem: p03637
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n=int(input())
l=[int(i) for i in input().split()]
s=sum(i%2==0 for i in l)
if s>=n/2:
    print('Yes')
else:
    print('No')
    

Failing test case input:
6
6 7 0 8 3 5

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
n=int(input())
l=[int(i) for i in input().split()]
s=0
s1=0 
for i in l:
    if i%4==0:
        s+=1 
    elif i%2==0:
        s1+=1 
if s+s1
    print('Yes')
else:
    print('No')

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
a_list = list(map(int, input().split()))

two_count = 0
two_sum = 0
four_count = 0
result = 'No'

for i in a_list:
    if i % 2 == 0:
        two_count += 1
        if i % 4 == 0:
            four_count += 1

if two_count == N:
    result = 'Yes'
elif two_count * 2 + 1 >= N:
    if (N - two_count) == 1:
        if four_count >= 1:
            result = 'Yes'
    else:
        if (N - two_count) - 1<= four_count:
            result = 'Yes'


print(result)


Failing test case input:
6
5 7 0 8 6 9

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
N = int(input())
a_list = list(map(int, input().split()))

one_count = 0
four_count = 0
two_count = 0
result = 'No'

for i in a_list:
    if i % 2 == 1:
        one_count += 1
    elif i % 4 == 0:
        four_count += 1
    else:
        two_count += 1

if one_count <= four_count or (one_count - 1  == four_count and two_count == 0):
    result = 'Yes'

print(result)

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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
if (d[2] >= 1 & d[1] <= d[4]) or d[1]+1 <= d[4]:
  print("Yes")
else:
  print("No")

Failing test case input:
6
5 7 0 0 6 9

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
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
if d.get(2, 0) >= 1:
  d[1] += 1
if d.get(1, 0) <= d.get(4, 0)+1:
  print("Yes")
else:
  print("No")
Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))

n2 = 0
n4 = 0

for ai in a:
  if ai % 4 == 2:
    n2 += 1
  if ai % 4 == 0:
    n4 += 1

if n2:
  n2 += 2
else:
  n2 = 1
if n2 + n4 * 2 >= n:
  print('Yes')
else:
  print('No')


Failing test case input:
3
1 1 -2

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int, input().split()))

n2 = 0
n4 = 0

for ai in a:
  if ai % 4 == 2:
    n2 += 1
  if ai % 4 == 0:
    n4 += 1

if n2 == 0 and n4:
  n2 += 1
if n2 + n4 * 2 >= n:
  print('Yes')
else:
  print('No')

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
a=map(int,input().split())
odd=[]
even=[]
adj=[]
for i in a:
    if i%2:odd.append(i)
    else:even.append(i)
    if i%4==0:adj.append(i)
L=len(adj)-len(odd)
if L+1>0:
    print("Yes")
    exit()
if L==-1:
    print(["Yes","No"][len(even)>0])
else:print("No")

Failing test case input:
3
1 -16 1

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
N=int(input())
a=map(int,input().split())
odd=[]
even=[]
adj=[]
for i in a:
    if i%2:odd.append(i)
    else:even.append(i)
    if i%4==0:adj.append(i)
L=len(adj)-len(odd)
if L+1>0:
    print("Yes")
    exit()
if L==-1:
    print(["Yes","No"][len(even)-len(adj)>0])
else:print("No")

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(map(int,input().split()))
m2 = 0
m4 = 0
other=0
for i, aa in enumerate(a):
    if aa % 4 == 0:
        m4 +=1
        continue
    if aa % 2 == 0:
        m2 += 1
        continue
    other += 1
if m4 >= other or m4 + 1 == other:
    print('Yes')
else:
    print('No')


Failing test case input:
6
5 7 0 8 6 9

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int,input().split()))
m2 = 0
m4 = 0
other=0
for i, aa in enumerate(a):
    if aa % 4 == 0:
        m4 +=1
        continue
    if aa % 2 == 0:
        m2 += 1
        continue
    other += 1
if m4 >= other or (m4 + 1 == other and m2 == 0):
    print('Yes')
else:
    print('No')

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
lst_a = list(map(int, input().split()))
cnt_4times = 0
cnt_odd = 0
cnt_even = 0
ans = "No"


for a in lst_a:
    if a % 4 == 0:
        cnt_4times += 1
    elif a % 2 != 0:
        cnt_odd += 1
    else:
        cnt_even += 1


if cnt_even == 0:
    if cnt_4times <= cnt_odd - 1:
        ans = "Yes"
else:
    cnt_odd += 1
    if cnt_4times >= cnt_odd:
        ans = "Yes"


print(ans)

Failing test case input:
6
6 7 0 8 2 9

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
N = int(input())
lst_a = list(map(int, input().split()))
cnt_4times = 0
cnt_odd = 0
cnt_even = 0
ans = "No"


for a in lst_a:
    if a % 4 == 0:
        cnt_4times += 1
    elif a % 2 != 0:
        cnt_odd += 1
    else:
        cnt_even += 1


if cnt_even != 0:
    cnt_odd += 1


if cnt_odd <= cnt_4times + 1:
    ans = "Yes"


print(ans)
Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from sys import exit

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

m1 = 0
m2 = 0
m4 = 0

for a in A:
	if a%4==0:
		m4 += 1
	elif a%2==0:
		m2 += 1
	else:
		m1 += 1

if m1==m4==0:
	print('Yes')
	exit()

m1 = m1 + (m2>0)
if 2*m4>=m1:
	print('Yes')
else:
	print('No')

Failing test case input:
6
5 7 0 8 6 9

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
from sys import exit

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

m1 = 0
m2 = 0
m4 = 0

for a in A:
	if a%4==0:
		m4 += 1
	elif a%2==0:
		m2 += 1
	else:
		m1 += 1


m1 = m1 + (m2>0)
if m4>=m1-1:
	print('Yes')
else:
	print('No')

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
input = sys.stdin.readline
n = int(input())
a = list(map(int,input().split()))
a2 = [i % 2 for i in a].count(0)
a4 = [i % 4 for i in a].count(0)
a0 = n - a2
a2 -= a4
print(a2,a4,a0)
if a2 == 0:
    if a0 <= a4+1:
        ans = "Yes"
    else:
        ans = "No"
else:
    if a0 <= a4:
        ans = "Yes"
    else:
        ans = "No"
print(ans)


Failing test case input:
3
0 28 010

Expected output:
Yes


Actual output:
1 2 0
Yes


Fixed submission (verdict: Accepted):
import sys
input = sys.stdin.readline
n = int(input())
a = list(map(int,input().split()))
a2 = [i % 2 for i in a].count(0)
a4 = [i % 4 for i in a].count(0)
a0 = n - a2
a2 -= a4
if a2 == 0:
    if a0 <= a4+1:
        ans = "Yes"
    else:
        ans = "No"
else:
    if a0 <= a4:
        ans = "Yes"
    else:
        ans = "No"
print(ans)

Problem: p03637
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
a = list(map(int,input().split()))
count2 = 0
count4 = 0
for i in range(n):
    
    if a[i]%2 == 0 and a[i]%4 != 0:
        count2 += 1
    
    elif a[i]%4 == 0:
        count4 += 3




if count2 >= 2 and count2%2 == 0:
    count4 += count2
elif count2 >= 2 and count2%2 == 1:
    count4 += count2

if count4 >= n:
    print("Yes")
else:
    print("No")

Failing test case input:
6
6 7 0 8 3 5

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int,input().split()))
count2 = 0
count4 = 0
for i in range(n):
    
    if a[i]%2 == 0 and a[i]%4 != 0:
        count2 += 1
    
    elif a[i]%4 == 0:
        count4 += 1

if count4 != 0:
    count4 = count4*2

if count2 >= 2:
    count4 += count2-1

if count4 >= n-1:
    print("Yes")
else:
    print("No")
Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

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

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

even = len(list(filter(lambda x: x % 2 == 0, A)))
even2 = len(list(filter(lambda x: x % 4 == 0, A)))
odd = N - even

ans = "No"
if even == N or even2 >= odd-1:
    ans = "Yes"
print(ans)


Failing test case input:
6
5 7 0 8 6 9

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):

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

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

even = len(list(filter(lambda x: x % 2 == 0, A)))
even2 = len(list(filter(lambda x: x % 4 == 0, A)))
odd = N-even
ans = "No"
if even == N:
    ans = "Yes"
if even-even2 == 0:
    if odd <= even2+1:
        ans = "Yes"
else:
    if odd <= even2:
        ans = "Yes"
print(ans)

Problem: p03637
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n=int(input())
l=list(map(int,input().split()))
x=0
y=0
c=0
for i in range(n):
    if(l[i]%4==0):
        x+=1
    elif(l[i]%2==0):
        y+=1
    else:
        c+=1
if(n%2==0):
    if(x>=c):
        print("Yes")
    else:
        print('No')
else:
    if(x>(c-1)):
        print("Yes")
    else:
        print("No")


Failing test case input:
3
1 -5 0

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
n=int(input())
l=list(map(int,input().split()))
x=0
y=0
c=0
for i in range(n):
    if(l[i]%4==0):
        x+=1
    elif(l[i]%2==0):
        y+=1
    else:
        c+=1
if(n%2==0):
    if(x>=c):
        print("Yes")
    else:
        print('No')
else:
    if(x>=(c-1)):
        print("Yes")
    else:
        print("No")
Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def count_four(lst):
    counter = 0
    for i in lst:
        if i%4 == 0:
            counter += 1
    return counter

def count_two(lst):
    counter = 0
    for i in lst:
        if i%2 == 0:
            counter += 1
    return counter

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

def solve(lst):
    four = count_four(lst)
    two = count_two(lst) - four
    others = n - four - two
    if four == 0 and others == 0:
        return "Yes"
    if four == 0 and two == 0:
        return "No"




    
    four += 1
    four -= others




    if four < 0 :
        return"No"
    else:
        return "Yes"

print(solve(lst))

Failing test case input:
6
6 7 0 8 3 9

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
def count_four(lst):
    counter = 0
    for i in lst:
        if i%4 == 0:
            counter += 1
    return counter

def count_two(lst):
    counter = 0
    for i in lst:
        if i%2 == 0:
            counter += 1
    return counter

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

def solve(lst):
    four = count_four(lst)
    two = count_two(lst) - four
    others = n - four - two

    if two == 0:
        if four + 1 - others >= 0:
            return "Yes"
        else:
            return "No"

    if two > 0:
        two = 1
        if four + 1 - others - two >= 0:
            return "Yes"
        else:
            return "No"


print(solve(lst))

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(input())
def S(): return input()

n=I()
a=IL()
ans="No"
a2=0
a4=0
for i in range(n):
    if a[i]%4==0:
        a4+=1
    elif a[i]%2==0:
        a2+=1
if 2*a4+a2>=n:
    ans="Yes"
if 2*a4+1>=n:
    ans="Yes"
print("ans")

Failing test case input:
3
0 0 -2

Expected output:
Yes


Actual output:
ans


Fixed submission (verdict: Accepted):

def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(input())
def S(): return input()

n=I()
a=IL()
ans="No"
a2=0
a4=0
for i in range(n):
    if a[i]%4==0:
        a4+=1
    elif a[i]%2==0:
        a2+=1
if 2*a4+a2>=n:
    ans="Yes"
if 2*a4+1>=n:
    ans="Yes"
print(ans)
Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
a_list = list(map(int, input().split()))

two_count = 0
two_sum = 0
four_count = 0
result = 'No'

for i in a_list:
    if i % 2 == 0:
        two_count += 1
        if i % 4 == 0:
            four_count += 1

if two_count * 2 + 1 >= N:
    if (N - two_count) == 1:
        if four_count == 1:
            result = 'Yes'
    else:
        if (N - two_count) - 1<= four_count:
            result = 'Yes'

print(result)


Failing test case input:
6
6 7 0 8 3 5

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
N = int(input())
a_list = list(map(int, input().split()))

one_count = 0
four_count = 0
two_count = 0
result = 'No'

for i in a_list:
    if i % 2 == 1:
        one_count += 1
    elif i % 4 == 0:
        four_count += 1
    else:
        two_count += 1

if one_count <= four_count or (one_count - 1  == four_count and two_count == 0):
    result = 'Yes'

print(result)

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N =input()
a =input().split()
b,c,d =0,0,0
for i in range(0,int(N)-1):
    hoge = int(a[i])%2
    if hoge ==0:
        b =b+1
for i in range(0,int(N)-1):
    hoge = int(a[i])%4
    if hoge ==0:
        c =c+1
d = b-c
if int(N)-3*c-d <=0:
    print('Yes')
else:
    print('No')


Failing test case input:
6
3 7 2 8 2 8

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
N =input()
a =input().split()
b,c,d =0,0,0
for i in range(0,int(N)):
    hoge = int(a[i])%2
    if hoge ==0:
        b =b+1
for i in range(0,int(N)):
    hoge = int(a[i])%4
    if hoge ==0:
        c =c+1
d = b-c
if d ==0:
    if c-(int(N)-b)+1>=0:
        print('Yes')
    else:
        print('No')
else:
    if c-(int(N)-b)>=0:
        print('Yes')
    else:
        print('No')

Problem: p03637
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
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 = 0

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

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




Failing test case input:
3
1 0 -5

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
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



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



if ans > 0:
    print('No')
else:
    print('Yes')
Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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
one=n-two-four
if one>=four+2 or\
one==four+1 and two>=1:
  print("No")
else:       
  print("YES")
  

Failing test case input:
3
1 -16 0

Expected output:
Yes


Actual output:
YES


Fixed submission (verdict: Accepted):
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
one=n-two-four
if one>=four+2 or\
one==four+1 and two>=1:
  print("No")
else:       
  print("Yes")

Problem: p03637
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = input()
L = list(map(int,input().split()))
n=0
m=0
p=0
for a in range(len(N)):
  if L[a]%2 != 0:
    n+=1
  elif L[a]%2 == 0 and L[a]%4 != 0:
    m+=1
  else:
    p+=1
if int(N)%2==1 and n>p+1:
  print("No")
elif int(N)%2==0 and n>p:
  print("No")
else:
  print("Yes")

Failing test case input:
3
3 -5 -1

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
N = input()
L = list(map(int,input().split()))
n=0
m=0
p=0
for a in range(int(N)):
  if L[a]%2 != 0:
    n+=1
  elif L[a]%2 == 0 and L[a]%4 != 0:
    m+=1
  else:
    p+=1
if int(N)%2==1 and (n>p+1 or p==0 and n==1):
  print("No")
elif int(N)%2==0 and n>p:
  print("No")
else:
  print("Yes")

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
a=list(map(int,input().split()))
not_two=0
yes_four=0
for i in a:
  if i%2!=0:
    not_two+=1
  if i%4==0:
    yes_four+=1
if yes_four-not_two>=0:
  print('Yes')
else:
  print('No')

Failing test case input:
3
0 11 101

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
n=int(input())
a=list(map(int,input().split()))
not_two=0
yes_four=0
for i in a:
  if i%2!=0:
    not_two+=1
  if i%4==0:
    yes_four+=1
if yes_four-not_two>=0:
  print('Yes')
elif yes_four+not_two==n and yes_four-not_two==-1:
  print('Yes')
else:
  print('No')

Problem: p03637
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N = int(input())
A = list(map(int, input().split()))

fours = 0
twos = 0
ones = 0
for i in range(N):
    if A[i] % 2 == 0:
        if A[i] >= 4:
            fours += 1
        else:
            twos += 1
    else:
        ones += 1

if twos:
    ones += 1

if ones <= fours + 1:
    print('Yes')
else:
    print('No')


Failing test case input:
3
1 -3 0

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int, input().split()))

fours = 0
twos = 0
ones = 0
for i in range(N):
    if A[i] % 4 == 0:
        fours += 1
    elif A[i] % 2 == 0:
        twos += 1
    else:
        ones += 1

if twos:
    ones += 1

if ones <= fours + 1:
    print('Yes')
else:
    print('No')
Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
_ = input()
A = list(map(int, input().strip().split(' ')))

a_4,a_2,a_1 = 0,0,0
for a in A:
  if a%4 == 0:
    a_4 += 1
  elif a%2 == 0:
    a_2 = 1
  else:
    a_1 += 1

if a_2 > 0:
  print('Yes' if (a_4+1) >= a_1+a_2 else 'No')
else:
  print('Yes' if a_4 >= a_1 else 'No')


Failing test case input:
3
-1 0 -1

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
_ = input()
A = list(map(int, input().strip().split(' ')))

a_4,a_2,a_1 = 0,0,0
for a in A:
  if a%4 == 0:
    a_4 += 1
  elif a%2 == 0:
    a_2 = 1
  else:
    a_1 += 1

print('Yes' if (a_4+1) >= (a_1+a_2) else 'No')

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))

n2 = 0
n4 = 0

for ai in a:
  if ai % 4 == 2:
    n2 += 1
  if ai % 4 == 0:
    n4 += 1

if n4:
  n4 += 1

if n2 + n4 * 2 >= n:
  print('Yes')
else:
  print('No')


Failing test case input:
4
0 2 3 7

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int, input().split()))

n2 = 0
n4 = 0

for ai in a:
  if ai % 4 == 2:
    n2 += 1
  if ai % 4 == 0:
    n4 += 1

if n2 == 0 and n4:
  n2 += 1
if n2 + n4 * 2 >= n:
  print('Yes')
else:
  print('No')

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math

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

mul_num = 0
two_num = 0
other_num = 0

for i in A:
    if i % 4 == 0:
        mul_num += 1
    elif i % 2 == 0:
        two_num += 1
    else:
        other_num += 1

if mul_num >= other_num:
    print('Yes')
else:
    print('No')



Failing test case input:
3
-1 0 -1

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
import math

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

mul_num = 0
two_num = 0
other_num = 0

for i in A:
    if i % 4 == 0:
        mul_num += 1
    elif i % 2 == 0:
        two_num += 1
    else:
        other_num += 1

if mul_num + two_num
    print('Yes')
else:
    print('No')

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))
mul4 = 0
mul2 = 0
has_mul2 = 0
other = 0
for i in a:
    if i%4 == 0:
        mul4 += 1
    elif i%2 == 0:
        mul2 += 1
        has_mul2 = 1
    else:
        other += 1

if mul4 > (has_mul2+other-1) or other == 0:
    print('Yes')
else:
    print('No')

Failing test case input:
6
6 7 0 8 6 9

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int, input().split()))
mul4 = 0
mul2 = 0
has_mul2 = 0
other = 0
for i in a:
    if i%4 == 0:
        mul4 += 1
    elif i%2 == 0:
        mul2 += 1
        has_mul2 = 1
    else:
        other += 1

if mul4 >= (has_mul2+other-1) or other == 0:
    print('Yes')
else:
    print('No')
Problem: p03637
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
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] % 4 == 2:
        two += 1
    else:
        pass
if four+two == N: print('Yes')
elif four == 0:
    print('No')
elif two <= 1 and N > 2*four+1:
    print('No')
elif N > 2*four+two:
    print('No')
else:
    print('Yes')


Failing test case input:
3
3 -8 -1

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
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] % 4 == 2:
        two += 1
    else:
        pass

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

Problem: p03637
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):

n=int(input())
a=list(map(int,input().split()))
cnt2=0
cnt4=0
for i in a:
    if i%4==0:
        cnt4+=1
    elif i%2==0:
        cnt2+=1
if cnt2>1:
    ans=n-cnt4*3-cnt2
if cnt2<=1:
    ans=n-cnt4*3
print("Yes" if ans<=0 else "No")


Failing test case input:
6
6 7 0 8 3 5

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):

n=int(input())
a=list(map(int,input().split()))
cnt2=0
cnt4=0
for i in a:
    if i%4==0:
        cnt4+=1
    elif i%2==0:
        cnt2+=1
if cnt2>1:
    ans=n-cnt4*2-cnt2
if cnt2<=1:
    ans=n-cnt4*2-1
print("Yes" if ans<=0 else "No")

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
aa = list(map(int,input().split()))

d2 = 0
d4 = 0

for ai in aa:
  if ai % 4 == 0:
    d4 += 1
  elif ai % 2 == 0:
    d2 += 1
  else:
    pass  

if d2<=1:
  d2=0
  
if d4*3 + d2 >= n :
  print('Yes')
else:
  print('No')  

Failing test case input:
6
5 7 0 0 6 9

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
n = int(input())
aa = list(map(int,input().split()))

d2 = 0
d4 = 0

for ai in aa:
  if ai % 4 == 0:
    d4 += 1
  elif ai % 2 == 0:
    d2 += 1
  else:
    pass  

if d2<=1:
  d2=0
else:
  d2 -= 1
dd = n - d2
if d4 >= dd
  print('Yes')
else:
  print('No')
Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import Counter
N = int(input())
alist = list(map(int,input().split()))
zero , one , two = 0 , 0 , 0
for a in alist:
    if a % 4 == 0:
        two += 1
    elif a % 2 == 0:
        one += 1
    else:
        zero += 1
def func(zero, one, two):
    if zero == 0 and one >= 2:
        return True
    if one == 0 :
        if (zero <= (two *2)):
            return True
        else:
            return False
    if (zero + 1 )  <= (two * 2): 
        return True
    return False
print("Yes" if func(zero , one, two) else "No")

Failing test case input:
6
4 7 0 -1 6 9

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
from collections import Counter
N = int(input())
alist = list(map(int,input().split()))
zero , one , two = 0 , 0 , 0
for a in alist:
    if a % 4 == 0:
        two += 1
    elif a % 2 == 0:
        one += 1
    else:
        zero += 1
def func(zero, one, two):
    if zero == 0:
        return True
    if one == 0 :
        if (zero <= (two + 1)):
            return True
        else:
            return False
    if (zero + 1 )  <= (two + 1): 
        return True
    return False
print("Yes" if func(zero , one, two) else "No")

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())






count4 = 0
count2 = 0
count_odd = 0
num_list = list(map(int, input().split()))
for i in num_list:
    if i % 4 == 0:
        count4 += 1
    elif i % 4 == 2:
        count2 += 1
    if i % 2 == 1:
        count_odd += 1
if count2 >= 1:
    real_count2 = 1
else:
    real_count2 = 0    
if count_odd == 0:
    print("Yes")
if  count_odd != 0 and count4 >= count_odd + count2 - 1:
    print("Yes")
else:
    print("No")

Failing test case input:
6
3 7 2 8 2 8

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
n = int(input())






count4 = 0
count2 = 0
count_odd = 0
num_list = list(map(int, input().split()))
for i in num_list:
    if i % 4 == 0:
        count4 += 1
    elif i % 4 == 2:
        count2 += 1
    if i % 2 == 1:
        count_odd += 1
if count2 >= 1:
    real_count2 = 1
else:
    real_count2 = 0    
if count_odd == 0:
    print("Yes")
else:
    if count4 >= count_odd + real_count2 - 1:
        print("Yes")    
    else:
        print("No")

Problem: p03637
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
import math
N = int(input())
A = list(map(int,input().split()))
l = list()
for i in range(len(A)):
  if A[i]%4 == 0:
    l.append(A[i])
four = len(l)

a = math.ceil(N/3)
b = A.count(0)

if a <= four and b == 0:
  print("Yes")
else:
  print("No")

Failing test case input:
6
6 7 0 8 2 9

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
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")
Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
input_list = [int(i) for i in input().split()]
four_count = 0
two_count = 0

for i in input_list:
    if i % 4 == 0:
        four_count += 1
    elif i % 2 == 0:
        two_count += 1

others_count = N - four_count - two_count

if two_count:
    if others_count <= four_count + 1:
        print("Yes")
    else:
        print("No")
else:
    if others_count <= four_count:
        print("Yes")
    else:
        print("No")
    

Failing test case input:
3
1 0 -3

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
N = int(input())
input_list = [int(i) for i in input().split()]
four_count = 0
two_count = 0

for i in input_list:
    if i % 4 == 0:
        four_count += 1
    elif i % 2 == 0:
        two_count += 1

others_count = N - four_count - two_count

if two_count:
    if others_count <= four_count:
        print("Yes")
    else:
        print("No")
else:
    if others_count <= four_count + 1:
        print("Yes")
    else:
        print("No")

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


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')

Failing test case input:
6
6 7 0 8 2 8

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):

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




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

x4 = odd = 0
for a in A:
    if a%4 == 0:
        x4 += 1
    elif a%2:
        odd += 1

if odd <= x4:
    print('Yes')
elif odd == x4+1:
    print('Yes' if x4+odd == N else 'No')
else:
    print('No')

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
a = list(map(int, input().split()))
cnt = 0
cnt2 = 0
cnt3 = 0
for i in a:
    if i % 4 == 0:
        cnt += 1
    if i == 2:
        cnt2 += 1
    else:
        cnt3 += 1

if cnt2 == 0:
    if cnt3 <= cnt + 1:
        print('Yes')
    else:
        print('No')
else:
    if cnt3 <= cnt:
        print('Yes')
    else:
        print('No')

Failing test case input:
3
-1 0 -1

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
N = int(input())
a = list(map(int, input().split()))
cnt = 0
cnt2 = 0
cnt3 = 0
for i in a:
    if i % 2 != 0:
        cnt3 += 1
    elif i % 4 == 0:
        cnt += 1
    else:
        cnt2 += 1

if cnt2 == 0:
    if cnt3 <= cnt + 1:
        print('Yes')
    else:
        print('No')
else:
    if cnt3 <= cnt:
        print('Yes')
    else:
        print('No')