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).
[{"code": "#!/usr/bin/env python\n\nn = int(input())\na = list(map(int, input().split()))\n\nn2 = 0 \nn4 = 0 \nfor i in range(n):\n    if a[i]%4 == 0:\n        n4 += 1\n    elif a[i]%2 == 0:\n        n2 += 1\n\nok = True\nif n2 == 0:\n    if n4 >= n//2:\n        ok = True\n    else:\n        ok = False\nelse:\n    n1 = n-n2-n4\n    n1 += 1\n    nn = n1+n4\n    if n4 >= nn//2:\n        ok = True\n    else:\n        ok = False\n\nif ok: \n    print('Yes')\nelse:\n    print('No')", "passed": true, "time": 0.23, "memory": 14280.0, "status": "done"}, {"code": "N = int(input())\nA =  list(map(int, input().split()))\n\nfour = 0\nodd = 0\nfor a in A:\n    if a % 2 == 1:\n        odd += 1\n    if a % 4 == 0:\n        four += 1\nif N % 2 == 1:\n    if odd - four <= 1:\n        print(\"Yes\")\n    else:\n        print(\"No\")\nelse:\n    if odd - four <= 0:\n        print(\"Yes\")\n    else:\n        print(\"No\")", "passed": true, "time": 0.24, "memory": 14180.0, "status": "done"}, {"code": "n = int(input())\na, b = 0, 0\nfor i in map(int, input().split()):\n    if i % 4 == 0:\n        a += 1\n    elif i % 2 == 0:\n        b += 1\nc = n - a - b\nif b == 0:\n    if a + 1 < c:\n        print(\"No\")\n    else:\n        print(\"Yes\")\nelse:\n    if a < c:\n        print(\"No\")\n    else:\n        print(\"Yes\")", "passed": true, "time": 0.24, "memory": 14176.0, "status": "done"}, {"code": "n=int(input())\na=list(map(int,input().split()))\ns=0\nt=0\nu=0\nfor i in range(n):\n  if a[i]%4==0:\n    s=s+1\n  elif a[i]%2==0:\n    t=t+1\n  else:\n    u=u+1\nif t>=1:\n  if s>=u:\n    print(\"Yes\")\n  else:\n    print(\"No\")\nelse:\n  if s-u>=-1:\n    print(\"Yes\")\n  else:\n    print(\"No\")\n    \n", "passed": true, "time": 0.14, "memory": 14116.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\n\nfour = 0\ntwo = 0\nother = 0\nfor i in a:\n    if i % 4 == 0:\n        four += 1\n    elif i % 2 == 0:\n        two += 1\n    else:\n        other += 1\n\nans = 'No'\nother += two % 2\nif four + 1 >= other:\n    ans = 'Yes'\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14120.0, "status": "done"}, {"code": "def main():\n    n = int(input())\n    As = list(map(int, input().split()))\n    fours = 0\n    evens = 0\n    odds = 0\n    for A in As:\n        if A % 4 == 0:\n            fours += 1\n        elif A % 2 == 0:\n            evens += 1\n        else:\n            odds += 1\n\n    if fours+(evens)//2 >= n//2:\n        ans = 'Yes'\n    else:\n        ans = 'No'\n    print(ans)\n\n\ndef __starting_point():\n    main()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "N = int(input())\nd4 = 0\nd2 = 0\nfor i in list(map(int,input().split())):\n    if i % 4 == 0:\n        d4 += 1\n    elif i % 2 == 0:\n        d2 += 1\n    else:\n        None\nif N <= d4*2 + 1:\n    print(\"Yes\")\nelif N - d4 * 2 <= d2 :\n    print(\"Yes\")\nelse:\n    print(\"No\")", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "N = int(input())\na = list(map(int, input().split()))\n\nnum2 = 0\nnum4 = 0\nodd = 0\nfor i in a:\n    if i % 4 == 0:\n        num4 += 1\n        continue\n    elif i % 2 == 0:\n        num2 += 1\n        continue\n    else:\n        odd += 1\n        continue\nif odd<=num4 or (N%2==1 and num4==N//2):\n    print('Yes')\nelse:\n    print('No')\n", "passed": true, "time": 0.24, "memory": 14160.0, "status": "done"}, {"code": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# FileName: \tC\n# CreatedDate:  2020-09-04 15:44:42 +0900\n# LastModified: 2020-09-13 16:06:20 +0900\n#\n\n\nimport os\nimport sys\n# import numpy as np\n# import pandas as pd\n\n\ndef main():\n    n = int(input())\n    A = list(map(int, input().split()))\n    A_4 = [x for x in A if x % 4 == 0]\n    A_2 = [x for x in A if x % 4 != 0 and x % 2 == 0]\n    A_0 = [x for x in A if x % 2 != 0]\n    if len(A_2) == 0 and len(A_0) <= len(A_4) + 1:\n        print(\"Yes\")\n    elif len(A_0) <= len(A_4):\n        print(\"Yes\")\n    else:\n        print(\"No\")\n\ndef __starting_point():\n    main()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14388.0, "status": "done"}, {"code": "N = int(input())\nA = [int(a) for a in input().split(\" \")]\n\nm_2_but_4 = 0\nm_4 = 0\nm_none = 0\nfor i in range(len(A)):\n  if A[i] % 4 == 0:\n    m_4 += 1\n  elif A[i] % 2 == 0:\n    m_2_but_4 += 1\n  else:\n    m_none += 1\n\nif m_2_but_4:\n  print(\"Yes\") if m_4 >= m_none else print(\"No\")\nelse:\n  print(\"Yes\") if m_4 + 1 >= m_none else print(\"No\")", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "import sys\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\nreadlines = sys.stdin.readlines\nsys.setrecursionlimit(10 ** 9)\nINF = 1 << 60\nMOD = 1000000007\n\n\ndef main():\n    N, *A = list(map(int, read().split()))\n    \n    m = sum(1 for a in A if a % 2 == 1)\n    n2 = sum(1 for a in A if a % 2 == 0 and a % 4 != 0)\n    n4 = sum(1 for a in A if a % 4 == 0)\n    \n    if m <= n4:\n        print('Yes')\n    elif m == n4 + 1:\n        if n2 == 0:\n            print('Yes')\n        else:\n            print('No')\n    else:\n        print('No')\n    \n    return\n\n\ndef __starting_point():\n    main()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14136.0, "status": "done"}, {"code": "N=int(input())\nls=[int(s) for s in input().split()]\na0=0\na2=0\nfor n in ls:\n  if n%2==1:\n    a0+=1\n  elif n%4==0:\n    a2+=1\nif a2>a0-1:\n  print('Yes')\nelif a2==a0-1:\n  if a0+a2<N:\n    print('No')\n  else:\n    print('Yes')\nelse:\n  print('No')", "passed": true, "time": 0.15, "memory": 14240.0, "status": "done"}, {"code": "_=int(input())\na=list(map(int,input().split()))\n\nx,y,z=0,0,0\nfor i in a:\n    if i%4 == 0:\n        z+=1\n    elif i%2 == 0:\n        y+=1\n    else:\n        x+=1\nif y:\n    if x <= z:\n        print('Yes')\n    else:\n        print('No')\nelse:\n    if x <= z+1:\n        print('Yes')\n    else:\n        print('No')", "passed": true, "time": 0.19, "memory": 14104.0, "status": "done"}, {"code": "N=int(input())\na=list(map(int,input().split()))\nl=[0]*N\nfor i in range(N):\n    if a[i]%4:\n        if a[i]%2:l[i]=1\n        else:l[i]=2\n    else:l[i]=4\nprint('Yes'if l.count(1)+(1 if l.count(2)else 0)<=1+l.count(4)else'No')", "passed": true, "time": 0.23, "memory": 14196.0, "status": "done"}, {"code": "n = int(input())\na = [int(x) for x in input().split()]\nres = \"No\"\n\ndef check(p):\n  if p % 4 == 0:\n    return 2\n  elif p % 2 == 0:\n    return 1\n  else:\n    return 0\n  \nc0 = 0\nc2 = 0\nc4 = 0\nfor i in range(n):\n  a[i] = check(a[i])\n  if a[i] == 2:\n    c4 += 1\n  elif a[i] == 1:\n    c2 += 1\n  else:\n    c0 += 1\n    \nif c0 == c4 + 1 and c2 == 0:\n  res = \"Yes\"\nelif c0 <= c4:\n  res = \"Yes\"\n\nprint(res)", "passed": true, "time": 0.14, "memory": 14280.0, "status": "done"}, {"code": "##\nN = int(input())\nN_List = list(map(int,input().split()))\nFour_List = [i for i in N_List if i % 4 == 0]\nTwo_List = [i for i in N_List if i % 2 == 0]\nif len(Two_List)-len(Four_List) > 0:\n    N = N - (len(Two_List) - len(Four_List)) + 1\n\nif N // 2 <= len(Four_List):\n    print(\"Yes\")\nelse:\n    print(\"No\")", "passed": true, "time": 0.15, "memory": 14308.0, "status": "done"}, {"code": "def even(x):\n    flag1 = False\n    if x % 2 == 0:\n        flag1 = True\n    return flag1\n\n\ndef multiple_of_4(x):\n    flag2 = False\n    if x % 2 == 0:\n        x //= 2\n        if x % 2 == 0:\n            flag2 = True\n    return flag2\n\n\ndef main():\n    n = int(input())\n    a_lst = list(map(int, input().split()))\n    flag = False\n\n    multiple_of_4_count = 0\n    for i in range(n):\n        if multiple_of_4(a_lst[i]):\n            multiple_of_4_count += 1\n\n    if multiple_of_4_count >= n // 2:\n        flag = True\n    else:\n        even_count = 0\n        for i in range(n):\n            if even(a_lst[i]):\n                even_count += 1\n        tmp = n - 2 * multiple_of_4_count\n        even_count -= multiple_of_4_count\n\n        if even_count >= tmp:\n            flag = True\n\n    if flag:\n        print('Yes')\n    else:\n        print('No')\n\n\ndef __starting_point():\n    main()\n__starting_point()", "passed": true, "time": 0.14, "memory": 14192.0, "status": "done"}, {"code": "N = int(input())\nA = list(map(int,input().split()))\nx = 0\ny = 0\n\nfor a in A:\n  if a%4==0:\n    x+=1\n  elif a%2==0:\n    y+=1\n\nif N//2<=x+y//2:\n  print(\"Yes\")\nelse:\n  print(\"No\")", "passed": true, "time": 0.16, "memory": 14296.0, "status": "done"}, {"code": "from collections import deque\n\nn = int(input())\nA = list(map(int, input().split()))\n\ncnt_2 = 0\ncnt_4 = 0\nfor i in range(n):\n    a = A[i]\n    if a%4==0:\n        cnt_4+=1\n    elif a%2==0:\n        cnt_2+=1\ncnt_else = n-cnt_2-cnt_4\ncnt_else += cnt_2%2\n\nif cnt_else-1 <= cnt_4:\n    print(\"Yes\")\nelse:\n    print(\"No\")", "passed": true, "time": 0.24, "memory": 14144.0, "status": "done"}, {"code": "n=int(input())\na=[int(i) for i in input().split()]\n\nA_num=0\nB_num=0\nC_num=0\n\nfor i in a:\n    if i%4==0:\n        C_num+=1\n    elif i%2==0:\n        B_num+=1\n    else:\n        A_num+=1\n\ndef ans():\n    if A_num==1:\n        if C_num>=1:\n            return True\n        return False\n    else:\n        if n==2*A_num-1:\n            if C_num==A_num-1:\n                return True\n            return False\n\n        elif n<2*A_num-1:\n            return False\n        else:\n            if C_num>=A_num:\n                return True\n            return False\nif ans():\n    print(\"Yes\")\nelse:\n    print(\"No\")\n", "passed": true, "time": 0.14, "memory": 14340.0, "status": "done"}, {"code": "n=int(input())\na=list(map(int, input().split()))\nx = 0\ny = 0\nfor i in a:\n    if i %2 != 0:\n        x+=1\n    elif i%4 == 0:\n        y+=1\nif y >=x:\n    print('Yes')\n    return\nelse:\n    if x+y == len(a) and y == x-1:\n        print('Yes')\n    else:\n        print('No')", "passed": true, "time": 0.24, "memory": 14296.0, "status": "done"}, {"code": "N = int(input())\na = list(map(int,input().split()))\n\ncnt2 = 0\ncnt4 = 0\ncntodd = 0\nfor i in a:\n    if i % 4 == 0:\n        cnt4 += 1\n    elif i % 2 == 0:\n        cnt2 += 1\n    else:\n        cntodd += 1\n\nif cnt2 == 0 and cnt4 + 1 >= cntodd:\n    ans = 'Yes'\nelif cnt4 >= cntodd:\n    ans = 'Yes'\nelse:\n    ans = 'No'\nprint(ans)    ", "passed": true, "time": 0.18, "memory": 14212.0, "status": "done"}, {"code": "\nN = int(input())\na = list(map(int,input().split()))\nsa=[]\nc = [0]*4\nans = 'No'\n\n#4\u3067\u5272\u3063\u305f\u4f59\u308a\u4e00\u89a7\u8868\u4f5c\u6210\nfor i in a:\n    sa.append(i%4)\n        \nfor i in sa:\n    c[i]+=1\n    \n#2\u306e\u500d\u6570\u304c\u306a\u3044\u6642\u3001\u5947\u6570\u306e\u6570\u306e\u548c\u304c4\u306e\u500d\u6570\u306e\u500b\u6570+1\u4ee5\u4e0b\u306a\u3089OK  \nif c[2]==0:\n    if c[1]+c[3]<=c[0]+1:\n        ans = 'Yes'\n#2\u306e\u500d\u6570\u304c\u3042\u308b\u6642\u3001\u307e\u3068\u3081\u3066\u7aef\u306b\u5bc4\u305b\u3066\u3001\u5947\u6570\u500b\u3067\u3082\u5076\u6570\u500b\u3067\u3082\u5947\u65701\u500b\u5206\u306e\u6271\u3044\u306b\u306a\u308b\n#\u3088\u3063\u3066\u5947\u6570\u306e\u6570\u306e\u548c\u304c4\u306e\u500d\u6570\u306e\u500b\u6570\u4ee5\u4e0b\u3067\u3042\u308c\u3070OK\nelse:\n    if c[1]+c[3]<=c[0]:\n        ans = 'Yes'\n\n#print(c)\nprint(ans)", "passed": true, "time": 0.16, "memory": 14112.0, "status": "done"}, {"code": "N = int(input())\na = list(map(int, input().split()))\ncount = 0\nhcount = 0\nfor x in a:\n    if x % 4 == 0:\n        count += 1\n    elif x % 2 == 0:\n        hcount += 1\n\nif (count + (hcount // 2)) >= (N // 2):\n    print('Yes')\nelse:\n    print('No')\n", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "from collections import Counter\nn=int(input())\na=list(map(int,input().split()))\namod4=list([x%4 for x in a])\nd=Counter(amod4)\nif n-d[0]-d[2]<d[0]+1:\n  print('Yes')\nelif d[2]==0 and n==2*d[0]+1:\n  print('Yes')\nelse:\n  print('No')\n", "passed": true, "time": 0.18, "memory": 14308.0, "status": "done"}, {"code": "#import\n#import math\n#import numpy as np\nN = int(input())\n#= input()\n#= map(int, input().split())\na = list(map(int, input().split()))\n#= [input(), input()]\n#= [list(map(int, input().split())) for _ in range(N)]\n#= {i:[] for i in range(N)}\n\nalen = N\ntwo = 0\nfour = 0\n\nfor aa in a:\n    if aa % 4 == 0:\n        four += 1\n    elif aa % 2 == 0:\n        two += 1\n\nother = alen - two - four\n\nres = False\n\nif other > four + 1:\n    pass\nelif other == four + 1:\n    if two == 0:\n        res = True\nelse:\n    res = True\n\nif res:\n    print(\"Yes\")\nelse:\n    print(\"No\")", "passed": true, "time": 0.14, "memory": 14096.0, "status": "done"}, {"code": "_ = input()\na = [int(x) for x in input().split()]\n\nodd = []\nm4 = []\nm2 = 0\nfor i in a:\n    if i % 2 != 0:\n        odd.append(i)\n    elif i % 4 == 0:\n        m4.append(i)\n    else:\n        m2 = 1\nelse:\n    lodd = len(odd)\n    if lodd == 0 or lodd + m2 - 1 <= len(m4):\n        print(\"Yes\")\n    else:\n        print(\"No\")", "passed": true, "time": 0.15, "memory": 14196.0, "status": "done"}, {"code": "n=int(input())\na=list(map(int,input().split()))\none=0\nfour=0\ntwo=0\nfor i in range(n):\n    cnt=0\n    num=a[i]\n    while num%2==0:\n        cnt+=1\n        num//=2\n    if cnt==0:\n        pin=1\n    elif cnt==1:\n        pin=2\n    else:\n        pin=4\n    if pin==1:\n        one+=1\n    elif pin==4:\n        four+=1\n    else:\n        two+=1\nif two>0:\n    one+=1\nif one<=four+1:\n    print(\"Yes\")\nelse:\n    print(\"No\")\n", "passed": true, "time": 0.14, "memory": 14140.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int,input().split()))\nt = [0 for _ in range(3)]\n\nfor i in range(n):\n\tif a[i] % 2 == 0:\n\t\tif a[i] % 4 == 0:\n\t\t\tt[2] += 1\n\t\telse:\n\t\t\tt[1] += 1\n\telse:\n\t\tt[0] += 1\n\nif t[0] + (t[1]%2) <= t[2] + 1:\n\tprint(\"Yes\")\nelse:\n\tprint(\"No\")", "passed": true, "time": 0.14, "memory": 14292.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\nfour = 0\ntwo = 0\nfor i in range(n):\n    if a[i] % 4 == 0:\n        four += 1\n    elif a[i] % 2 == 0:\n        two += 1\n\nif 2 * four + 1 >= n:\n    print(\"Yes\")\nelif 2 * four + two >= n:\n    print(\"Yes\")\nelse:\n    print(\"No\")\n", "passed": true, "time": 0.14, "memory": 14336.0, "status": "done"}, {"code": "import math\nN = int(input())\nA = list(map(int, input().split()))\ncount = []\nfor i in A:\n    if i%4 == 0:\n        count.append(\"4\")\n    elif i%2 == 0:\n        count.append(\"2\")\n    else:\n        count.append(\"1\")\nB1 = count.count(\"4\")\nB2 = count.count(\"1\")\nif count.count(\"2\") == 0:\n    print(\"Yes\" if B1+1 >= B2 else \"No\")\nelse:\n    print(\"Yes\" if B1 >= B2 else \"No\")", "passed": true, "time": 0.14, "memory": 14260.0, "status": "done"}, {"code": "_ = input()\na = [int(x) for x in input().split()]\n\nodd = []\nm4 = []\nm2 = 0\nfor i in a:\n    if i % 2 != 0:\n        odd.append(i)\n    elif i % 4 == 0:\n        m4.append(i)\n    else:\n        m2 = 1\nelse:\n    if len(odd) + m2 - 1 <= len(m4):\n        print(\"Yes\")\n    else:\n        print(\"No\")", "passed": true, "time": 0.14, "memory": 14252.0, "status": "done"}, {"code": "n = int(input())\na_lst = list(map(int, input().split()))\n\ncnt = 0\nfor a in a_lst:\n  if a % 4 == 0:\n    cnt += 2\n  elif a % 2 == 0:\n    cnt += 1\n  else:\n    pass\n\nif cnt // 2 >= n // 2:\n  print('Yes')\nelse:\n  print('No')", "passed": true, "time": 0.18, "memory": 14092.0, "status": "done"}, {"code": "N=int(input())\na=list(map(int,input().split()))\nfor i in range(N):\n    if a[i]%4==0:\n        a[i]=2\n    elif a[i]%2==0:\n        a[i]=1\n    else:\n        a[i]=0\nzero=a.count(0)\none=a.count(1)\ntwo=a.count(2)\n\nif zero>two+1:\n    print(\"No\")\nelif zero==two+1:\n    if zero+two==N:\n        print(\"Yes\")\n    else:\n        print(\"No\")\nelse:\n    print(\"Yes\")\n", "passed": true, "time": 0.23, "memory": 14308.0, "status": "done"}, {"code": "from collections import defaultdict\n\nd = defaultdict(int)\nd=[0]*3\nn = int(input())\n\nfor i in list(map(int, input().split())):\n  if i % 4 == 0:\n    d[2] += 1\n  elif i % 2 == 0:\n    d[1] += 1\n  else:\n    d[0] += 1\nt = d[2] - d[1]\nif (d[0] <= d[2]) or ((d[0] == d[2] + 1) and (d[1] == 0)):\n  print(\"Yes\")\nelse:\n  print(\"No\")\n", "passed": true, "time": 0.15, "memory": 14256.0, "status": "done"}, {"code": "#\n# abc069 c\n#\nimport sys\nfrom io import StringIO\nimport unittest\n\n\nclass TestClass(unittest.TestCase):\n    def assertIO(self, input, output):\n        stdout, stdin = sys.stdout, sys.stdin\n        sys.stdout, sys.stdin = StringIO(), StringIO(input)\n        resolve()\n        sys.stdout.seek(0)\n        out = sys.stdout.read()[:-1]\n        sys.stdout, sys.stdin = stdout, stdin\n        self.assertEqual(out, output)\n\n    def test_\u5165\u529b\u4f8b_1(self):\n        input = \"\"\"3\n1 10 100\"\"\"\n        output = \"\"\"Yes\"\"\"\n        self.assertIO(input, output)\n\n    def test_\u5165\u529b\u4f8b_2(self):\n        input = \"\"\"4\n1 2 3 4\"\"\"\n        output = \"\"\"No\"\"\"\n        self.assertIO(input, output)\n\n    def test_\u5165\u529b\u4f8b_3(self):\n        input = \"\"\"3\n1 4 1\"\"\"\n        output = \"\"\"Yes\"\"\"\n        self.assertIO(input, output)\n\n    def test_\u5165\u529b\u4f8b_4(self):\n        input = \"\"\"2\n1 1\"\"\"\n        output = \"\"\"No\"\"\"\n        self.assertIO(input, output)\n\n    def test_\u5165\u529b\u4f8b_5(self):\n        input = \"\"\"6\n2 7 1 8 2 8\"\"\"\n        output = \"\"\"Yes\"\"\"\n        self.assertIO(input, output)\n\n\ndef resolve():\n    N = int(input())\n    A = list(map(int, input().split()))\n\n    Q = 0\n    E = 0\n    O = 0\n    for a in A:\n        if a % 4 == 0:\n            Q += 1\n        elif a % 2 == 0:\n            E += 1\n        else:\n            O += 1\n\n    if N-2*Q <= 0 or (N-2*Q) == 1 or N-2*Q == E:\n        print(\"Yes\")\n    else:\n        print(\"No\")\n\n\ndef __starting_point():\n    # unittest.main()\n    resolve()\n\n__starting_point()", "passed": true, "time": 0.23, "memory": 14512.0, "status": "done"}, {"code": "n = int(input())\nA=list(map(int, input().split()))\n\nans=\"No\"\nc1=c2=c4=0\nfor a in A:\n    if a%4==0:\n        c4+=1\n    elif a%2==0:\n        c2+=1\n    else:\n        c1+=1\n\nif c4==0 and c1>0 :\n    ans=\"No\"\nelif c1<=c4+(c2==0) :\n    ans=\"Yes\"\nelse:\n    ans=\"No\"\n\nprint( ans )\n\n", "passed": true, "time": 0.14, "memory": 14392.0, "status": "done"}, {"code": "N=int(input())\na=list(map(int,input().split()))\n\nn4,n2=0,0\nfor i in range(N):\n  if a[i] % 4 == 0:n4 += 1\n  elif a[i] % 2 == 0:n2 += 1\n    \nif n4 >= N//2:print('Yes')\nelif n4*2 + n2 >= N:print('Yes')\nelse:print('No')", "passed": true, "time": 0.16, "memory": 14352.0, "status": "done"}, {"code": "n=int(input())\na=list(map(int,input().split()))\n\nx2=0\nx4=0\nx1=0\nfor x in a:\n  if x%2==0:\n    x2+=1\n  if x%4==0:\n    x4+=1\n  if x%2==1:\n    x1+=1\n    \nif x4+x1==n:\n  if x4>=x1-1:\n    print('Yes')\n  else:\n    print('No')\n  \nelse:\n  if x4>=x1:\n    print('Yes')\n  else:\n    \n    print('No')\n", "passed": true, "time": 0.22, "memory": 14244.0, "status": "done"}, {"code": "input();a=list(map(int,input().split()))\nb1,b2,b4=0,0,0\nfor i in a:\n  if i%2!=0: b1+=1\n  elif i%4==0: b4+=1\n  else: b2+=1\nprint('Yes' if b1<=b4 else 'No' if b2 else 'Yes' if b1<=b4+1 else 'No')", "passed": true, "time": 0.14, "memory": 14144.0, "status": "done"}, {"code": "n = int(input())\nan = [int(num) for num in input().split()]\n\none,two,four = 0, 0, 0\nfor a in an:\n  if a%4 == 0:\n    four += 1\n  elif a%2 == 0:\n    two += 1\n  else :\n    one += 1\n    \nif two == 0 and four >= one - 1 :\n  print(\"Yes\")\nelif four >= one :\n  print(\"Yes\")\nelse :\n  print(\"No\")", "passed": true, "time": 0.29, "memory": 14252.0, "status": "done"}, {"code": "N = int(input())\na = list(map(int,input().split()))\nf = []\nt = []\no = []\nans = 'No'\n\nfor i in a:\n    if i%4==0:\n        f.append(i)\n    elif i%2==0:\n        t.append(i)\n    else:\n        o.append(i)\n\nif len(t)==0:\n    if len(o)<=len(f)+1:\n        ans = 'Yes'\nelse:\n    if len(o)<=len(f):\n        ans = 'Yes'\nprint(ans)", "passed": true, "time": 0.15, "memory": 14288.0, "status": "done"}, {"code": "n=int(input())\na=list(map(int,input().split()))\nx=0\ny=0\nfor i in range(n):\n  if a[i]%2!=0:\n    x+=1\n  elif a[i]%4==0:\n    y+=1\n\nif x<=y:\n  print(\"Yes\")\nelse:\n  if x+y==n and x==y+1:\n    print(\"Yes\")\n  else:\n    print(\"No\")", "passed": true, "time": 0.29, "memory": 14340.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\nfour = 0\ntwo = 0\nfor i in range(n):\n    if a[i] % 4 == 0:\n        four += 1\n    elif a[i] % 2 == 0:\n        two += 1\n\nif four >= n // 2 or n - 2 * four <= two:\n    print(\"Yes\")\nelse:\n    print(\"No\")\n", "passed": true, "time": 0.14, "memory": 14252.0, "status": "done"}, {"code": "input();a=list(map(int,input().split()))\nb1,b2,b4=0,0,0\nfor i in a:\n  if i%2!=0: b1+=1\n  elif i%4==0: b4+=1\n  elif i%2==0: b2+=1\nprint('Yes' if b1<=b4 else 'No' if b2 else 'Yes' if b1<=b4+1 else 'No')", "passed": true, "time": 0.28, "memory": 14148.0, "status": "done"}, {"code": "from collections import Counter\n\nn = int(input())\nA = list(map(int, input().split()))\nA = [min(x & -x, 4) for x in A]\n\nCA = Counter(A)\nnum0 = CA[1]\nnum1 = CA[2]\nnum2 = CA[4]\nif num1:\n    num1 = 1\nif num2 - (num1 + num0) >= -1:\n    print(\"Yes\")\n\nelse:\n    print(\"No\")\n", "passed": true, "time": 0.23, "memory": 14284.0, "status": "done"}, {"code": "n = int(input())\nal = list(map(int, input().split()))\n\ncount2 = 0\ncount4 = 0\n\nfor a in al:\n    if a % 4 == 0:\n        count4 += 1\n    elif a%2==0:\n        count2+=1\n\nv=count2//2\n\nn-=v*2\nif count4 >= n//2:\n    ans='Yes'\nelse:\n    ans='No'\n\nprint(ans)", "passed": true, "time": 0.22, "memory": 14272.0, "status": "done"}, {"code": "import sys\n\nsys.setrecursionlimit(10 ** 8)\nini = lambda: int(sys.stdin.readline())\ninl = lambda: [int(x) for x in sys.stdin.readline().split()]\nins = lambda: sys.stdin.readline().rstrip()\ndebug = lambda *a, **kw: print(\"\\033[33m\", *a, \"\\033[0m\", **dict(file=sys.stderr, **kw))\n\n\ndef solve():\n    n = ini()\n    a = inl()\n\n    c4, c2 = 0, 0\n    for x in a:\n        if x % 4 == 0:\n            c4 += 1\n        elif x % 2 == 0:\n            c2 += 1\n    c1 = n - c2 - c4\n\n    if c4 == 0:\n        return c1 == 0 and c2 >= 2\n    return c4 >= c1 or (c4 + 1 == c1 and c2 == 0)\n\n\nprint(\"Yes\" if solve() else \"No\")\n", "passed": true, "time": 0.14, "memory": 14196.0, "status": "done"}, {"code": "n = int(input())\na_ls = list(map(int, input().split()))\nn_4k = 0\nn_2k = 0\nn_odd = 0\nfor i in range(n):\n    if a_ls[i] % 4 ==0:\n        n_4k += 1\n    elif a_ls[i] % 2 ==0:\n        n_2k += 1\n    else:\n        n_odd += 1\nres = 'No'\nif n_odd == 0:\n    res = 'Yes'\nelse:\n    if n_2k > 0:\n        if n_odd <= n_4k:\n            res = 'Yes'\n    else:\n        if n_odd <= n_4k+1:\n            res = 'Yes'\nprint(res)", "passed": true, "time": 0.18, "memory": 14208.0, "status": "done"}, {"code": "n=int(input()) \nc=list(map(int, input().split()))\na = 0\na2 = 0\na4 = 0\n\nfor i in c:\n    if i%2 != 0:\n        a += 1\n    if i%2 == 0 and i%4 != 0:\n        a2 += 1\n    if i%4 == 0:\n        a4 += 1\nif a == 0 :\n    print('Yes')\nif a > 0 and a2 == 0:\n    if a <= a4 +1 :\n        print('Yes')\n    else:\n        print('No')\nif a > 0 and a2 > 0:\n    if a <= a4 :\n        print('Yes')\n    else:\n        print('No')", "passed": true, "time": 0.14, "memory": 14360.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\nc_ki = 0\nc_4 = 0\nc_2 = 0\nfor i in range(n):\n  if a[i] % 2 == 1:\n    c_ki += 1\n  elif a[i] % 4 == 0:\n    c_4 += 1\n  else:\n    c_2 += 1\nif c_ki <= c_4:\n  print(\"Yes\")\nelif c_ki-1 == c_4 and c_2 == 0:\n  print(\"Yes\")\nelse:\n  print(\"No\")", "passed": true, "time": 0.14, "memory": 14376.0, "status": "done"}, {"code": "N = int(input())\na = [int(x) for x in input().split()]\ncnt4 = 0\ncnt2 = 0\nfor x in a:\n    if x % 4 == 0:\n        cnt4 += 1\n        continue\n    if x % 2 == 0:\n        cnt2 += 1\ncnt2 = cnt2//2*2\nif N-cnt2 > 2*cnt4+1:\n    print('No')\nelse:\n    print('Yes')", "passed": true, "time": 0.14, "memory": 14188.0, "status": "done"}, {"code": "n=int(input())\na=list(map(int,input().split()))\nb,c,d=0,0,0\nfor i in a:\n    if i%4==0:\n        b+=1\n    elif i%2==0:\n        c+=1\n    else:\n        d+=1\nif c==0 and b>=d-1:\n    print(\"Yes\")\nelif b>=d:\n    print(\"Yes\")\nelse:\n    print(\"No\")", "passed": true, "time": 0.14, "memory": 14080.0, "status": "done"}, {"code": "n = int(input())\nA = list(map(int, input().split()))\n\nmulti_4 = 0\nmulti_2 = 0\nodd = 0\nfor a in A:\n    if a % 4 == 0:\n        multi_4 += 1\n    elif a % 2 == 0:\n        multi_2 += 1\n    else:\n        odd += 1\n\nif multi_2 > 0:\n    if odd > multi_4:\n        print('No')\n    else:\n        print('Yes')\nelse:\n    if odd > multi_4 + 1:\n        print('No')\n    else:\n        print('Yes')\n", "passed": true, "time": 0.15, "memory": 14328.0, "status": "done"}, {"code": "N = int(input())\nA = list(map(int,input().split()))\n\ntwo = 0\nfour = 0\nodd = 0\n\nfor a in A:\n  if a % 4 == 0:\n    four += 1\n  elif a % 2 == 0:\n    two += 1\n\nN -= max(0, two - 1)\n\nprint(\"Yes\" if four >= N // 2 else \"No\")", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "import sys\n\nn=int(input())\na=[int(x) for x in input().rstrip().split()]\n\neven=0\nodd=0\nnum4=0\nfor i in a:\n  if i%4==0:\n    num4+=1\n    continue\n\n  elif i%2==0:\n    even+=1\n  else:\n    odd+=1\n\n\nif odd<=num4:\n  print(\"Yes\")\nelif odd-1==num4 and even==0:\n  print(\"Yes\")\nelif odd==0 and 2<=even:\n  print(\"Yes\")\nelse:\n  print(\"No\")", "passed": true, "time": 0.14, "memory": 14120.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int,input().split()))\n\ncodd = 0\ncfour = 0\n\nfor i in range(n):\n\tif a[i]%2 != 0:\n\t\tcodd += 1\n\tif a[i]%4 == 0:\n\t\tcfour += 1\nceven = n - cfour - codd\n\nif cfour >= codd:\n\tprint('Yes')\nelif ceven == 0 and cfour + 1 == codd:\n\tprint('Yes')\nelse:\n\tprint('No')", "passed": true, "time": 0.14, "memory": 14316.0, "status": "done"}, {"code": "import math\nn = int(input())\na = list(map(int, input().split()))\nc2 = 0\nc4 = 0\nfor i in a:\n    if i%4==0:\n        c4+=1\n    elif i%2==0:\n        c2+=1\n\nif c2 == len(a):\n    print('Yes')\nelif c2 >= 2:\n    if c4 >= (math.ceil((len(a)-c2)/2)):\n        print('Yes')\n    else:\n        print('No')\nelif c4 >=(len(a)//2):\n    print('Yes')\nelse:\n    print('No')", "passed": true, "time": 0.15, "memory": 14156.0, "status": "done"}, {"code": "n=int(input())\nl=list(map(int,input().split()))\nx,y,z=0,0,0\nfor a in l:\n    if a%4==0:\n        z+=1\n    elif a%2==0:\n        y+=1\n    else:\n        x+=1\nif y>0:\n    x+=1\nprint(('Yes'if x<=z+1 else'No'))\n", "passed": true, "time": 0.14, "memory": 14116.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\n\nx = 0\ny = 0\nz = 0\nfor i in a:\n  if i%4 == 0: x += 1\n  elif i%2 == 0: y += 1\n  else: z += 1\n\nif y%2+z-1 <= x: print(\"Yes\")\nelse: print(\"No\")", "passed": true, "time": 0.15, "memory": 14312.0, "status": "done"}, {"code": "n=int(input())\na=list(map(int,input().split()))\nc2=0\nc4=0\nfor aa in a:\n  if aa%2 == 0:\n    if aa%4 == 0:\n      c4+=1\n    else:\n      c2+=1\nc0=n-(c2+c4)\ncc=c4-c0\nif c2>=1 and c2 != n:\n  cc-=1\nprint((\"Yes\" if cc >= -1 else \"No\"))\n", "passed": true, "time": 0.14, "memory": 14080.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\na4 = []\na2 = []\na1 = []\nfor i in range(n):\n    if a[i] % 4 == 0:\n        a4.append(a[i])\n    elif a[i] % 2 == 0:\n        a2.append(a[i])\n    else:\n        a1.append(a[i])\nif len(a4) >= n//2:\n    print(\"Yes\")\nelif len(a4) + len(a2)//2 >= n//2:\n    print(\"Yes\")\nelse:\n    print(\"No\")", "passed": true, "time": 0.18, "memory": 14280.0, "status": "done"}, {"code": "def main():\n    n = int(input())\n    a = [int(an) for an in input().split()]\n    exist2 = False\n    not4 = 0\n    count4 = 0\n    for an in a:\n        if an % 2 == 0:\n            if an % 4 == 0:\n                count4 += 1\n            else:\n                if not exist2:\n                    exist2 = True\n                    not4 += 1\n        else:\n            not4 += 1\n    print(('Yes' if count4 >= not4 - 1 else 'No'))\n\n\ndef __starting_point():\n    main()\n\n__starting_point()", "passed": true, "time": 0.18, "memory": 14104.0, "status": "done"}, {"code": "N = int(input())\nA = list(map(int, input().split()))\nmod0 = 0\nmod2 = 0\nmod13 = 0\n\nfor a in A:\n  mod = a % 4\n  if mod == 0:\n    mod0 += 1\n  elif mod == 2:\n    mod2 += 1\n  else:\n    mod13 += 1\n    \nif mod2 > 0:\n  if mod13 <= mod0:\n    print('Yes')\n  else:\n    print('No')\nelse:\n  if mod13-1 <= mod0:\n    print('Yes')\n  else:\n    print('No')", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "N=int(input())\na=list(map(int,input().strip().split()))\n\neven=0\nodd=0\nfour=0\nfor n in range(N):\n    if a[n]%4==0:\n        four+=1\n    elif a[n]%2==0:\n        even+=1\n    else:\n        odd+=1\n\nif odd==0:\n    print(\"Yes\")\nelse:\n    if even==0:\n        if four>=odd-1:\n            print(\"Yes\")\n        else:\n            print(\"No\")\n    else:\n        if four>=odd:\n            print(\"Yes\")\n        else:\n            print(\"No\")", "passed": true, "time": 0.15, "memory": 14252.0, "status": "done"}, {"code": "n = int(input())\na_list = list(map(int, input().split()))\n\nx = y = z = 0\nfor a in a_list:\n    if a % 4 == 0:\n        x += 1\n    elif a % 2 == 0:\n        y += 1\n    else:\n        z += 1\nif (y == 0 and x >= z - 1) or (y > 0 and x >= z):\n    print(\"Yes\")\nelse:\n    print(\"No\")", "passed": true, "time": 0.15, "memory": 14092.0, "status": "done"}, {"code": "n = int(input())\n\narr = list(map(int, input().split()))\n\nodd_num = len([e for e in arr if e % 2 != 0])\nfour_num = len([e for e in arr if e % 4 == 0])\neven_num = n - odd_num - four_num\n\nif even_num:\n    print(\"Yes\" if four_num >= odd_num else \"No\")\nelse:\n    print(\"Yes\" if four_num >= odd_num - 1 else \"No\")", "passed": true, "time": 0.14, "memory": 14320.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\n\nx,y,z = 0,0,0\nfor i in a:\n  if i%4 == 0: x += 1\n  elif i%2 == 0: y += 1\n  else: z += 1\n    \nif x >= z-1+y%2: print(\"Yes\")\nelse: print(\"No\")", "passed": true, "time": 0.25, "memory": 14084.0, "status": "done"}, {"code": "n = int(input())\nA = list(map(int, input().split()))\nd, q, x = 0, 0, 0\nfor a in A:\n    if a % 4 == 0:\n        q += 1\n    elif a % 2 == 0:\n        d += 1\n    else:\n        x += 1\nx += d % 2\nd -= d % 2\nif q+1 >= x:\n    print('Yes')\nelse:\n    print('No')\n# print(d,q,x)\n", "passed": true, "time": 0.14, "memory": 14340.0, "status": "done"}, {"code": "n=int(input())\n\nL=list(map(int,input().split()))\na=0\nb=0\n\nfor i in range(n):\n\tif L[i]%4==0:\n\t\tb+=1\n\tif L[i]%2==1:\n\t\ta+=1\n\nif a+b==n and a-b==1:\n\tprint('Yes')\n\treturn\nif b>=a:\n\tprint('Yes')\nelse:\n\tprint('No')", "passed": true, "time": 0.15, "memory": 14276.0, "status": "done"}, {"code": "N=int(input())\n*A,=map(int,input().split())\n\ni1=len([i for i in A if i%2!=0])\ni4=len([i for i in A if i%4==0])\ni2=min(1,N-i1-i4)\n\n# print(i1,i2,i4)\nprint('Yes' if (i1+i2-1)<=i4 else 'No')", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "N = int(input())\nA = list(map(int, input().split()))\ncnt_odd = 0\ncnt_4 = 0\nfor a in A:\n    if a % 2 != 0:\n        cnt_odd += 1\n    elif a % 4 == 0:\n        cnt_4 += 1\nif cnt_odd + cnt_4 == N and cnt_odd -1 == cnt_4:\n    print('Yes')\nelse:\n    print(('Yes' if cnt_4 >= cnt_odd else 'No'))\n", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "_ = input()\na = [int(x) for x in input().split()]\n\nodd, m4, m2 = 0, 0, 0\nfor i in a:\n    if i % 2 != 0:\n        odd += 1\n    elif i % 4 == 0:\n        m4 += 1\n    else:\n        m2 = 1\nelse:\n    if odd + m2 - 1 <= m4:\n        print(\"Yes\")\n    else:\n        print(\"No\")", "passed": true, "time": 0.14, "memory": 14092.0, "status": "done"}, {"code": "N = int(input())\na = list(map(int,input().split()))\nc2 = 0\nc4 = 0\nfor i in range(N):\n    if a[i]%4 == 0:\n        c4 += 1\n    elif a[i]%2 == 0:\n        c2 += 1\nf = c4 * 2 + 1\nif f >= N or f + c2 - 1 >= N:\n    print(\"Yes\")\nelse:\n    print(\"No\")", "passed": true, "time": 0.14, "memory": 14196.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\n\ncnt4 = 0\ncnt2 = 0\nfor i in a:\n    if i % 4 == 0:\n        cnt4 += 1\n    elif i % 2 == 0:\n        cnt2 += 1\n\nif cnt4 >= n//2:\n    print('Yes')\nelif 2 * cnt4 >= n - cnt2:\n    print('Yes')\nelse:\n    print('No')", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun Sep 27 02:20:18 2020\n\n@author: liang\n\"\"\"\n\nN = int(input())\nA = [int(x) for x in input().split()]\n\nc0 = 0\nc4 = 0\nfor a in A:\n    if a%2 == 1:\n        c0 += 1\n    elif a%4 == 0:\n        c4 += 1\n\nif c0 <= c4:\n    print(\"Yes\")\nelse:\n    if c0 + c4 == N and c0 == c4 + 1:\n        print(\"Yes\")\n    else:\n        print(\"No\")", "passed": true, "time": 0.14, "memory": 14192.0, "status": "done"}, {"code": "n = int(input())\nli = list(map(int,input().split()))\nlis = []\nx = 0\ny = 0\nz = 0\nfor i in range(n):\n    if li[i] % 4 == 0:\n        x += 1\n    elif li[i] % 2 == 0:\n        y = 1\n    else:\n        z += 1\nif y == 0:\n    if x + 1 >= z:\n        print(\"Yes\")\n    else:\n        print(\"No\")\nelse:\n    if x >= z:\n        print(\"Yes\")\n    else:\n        print(\"No\")", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "N = int(input())\nA = list(map(int, input().split()))\n\nother, two, four = (0, 0, 0)\nfor a in A:\n  if a%4 == 0:\n    four += 1\n  elif a%2 == 0:\n    two += 1\n  else:\n    other += 1\n    \nans = \"No\"\nif other <= four:\n  ans = \"Yes\"\nelif other-four == 1 and two == 0:\n  ans = \"Yes\"\n  \nprint(ans)\n", "passed": true, "time": 0.15, "memory": 14236.0, "status": "done"}, {"code": "input();a=list(map(int,input().split()))\nb1,b2,b4=[],[],[];ans=''\nfor i in a:\n  if i%2!=0:\n    b1.append(i)\n  elif i%4==0:\n    b4.append(i)\n  elif i%2==0:\n    b2.append(i)\nif b2:\n  if len(b1)<=len(b4):\n    ans='Yes'\n  else:\n    ans='No'\nelse:\n  if len(b1)<=len(b4)+1:\n    ans='Yes'\n  else:\n    ans='No'\nprint(ans)", "passed": true, "time": 0.14, "memory": 14348.0, "status": "done"}, {"code": "import collections\n_ = input()\nA = collections.Counter(int(T) for T in input().split()).most_common()\nNum4 = sum(A[T][1] for T in range(0,len(A)) if A[T][0]%4==0)\nNum2 = sum(A[T][1] for T in range(0,len(A)) if A[T][0]%4!=0 and A[T][0]%2==0)\nOdd  = sum(A[T][1] for T in range(0,len(A)) if A[T][0]%2!=0)\nif Num2>0: Capacity = Num4\nelse: Capacity = Num4+1\nif Capacity>=Odd: print('Yes')\nelse: print('No')", "passed": true, "time": 0.14, "memory": 14332.0, "status": "done"}, {"code": "N = int(input())\nlsa = list(map(int,input().split()))\nans = 'Yes'\ni4 = 0\ni2 = 0\ni1 = 0\nfor i in range(N):\n    if lsa[i] % 4 == 0:\n        i4 += 1\n    elif lsa[i] % 2 == 0:\n        i2 += 1\n    else:\n        i1 += 1\nif i4+1 < i1:\n    ans = 'No'\nelif i2%2 == 1 and i4+1 == i1:\n    ans = 'No'\nprint(ans)", "passed": true, "time": 0.15, "memory": 14248.0, "status": "done"}, {"code": "input();a,b1,b2,b4=list(map(int,input().split())),0,0,0\nfor i in a:\n  if i%2!=0: b1+=1\n  elif i%4==0: b4+=1\n  else: b2+=1\nprint('Yes'if b1<=b4 else'No'if b2 else'Yes'if b1<=b4+1 else'No')", "passed": true, "time": 0.14, "memory": 14036.0, "status": "done"}, {"code": "n = int(input())\na_list = [int(x) for x in input().split()]\nx = y = z = 0\nfor a in a_list:\n    if a % 4 == 0:\n        x += 1\n    elif a % 2 == 0:\n        y += 1\n    else:\n        z += 1\nprint(\"Yes\" if (y == 0 and x >= z - 1) or (y > 0 and x >= z) else \"No\")", "passed": true, "time": 0.14, "memory": 14104.0, "status": "done"}, {"code": "import sys\ninput = sys.stdin.readline\n\nN = int(input())\na = list(map(int,input().split()))\n\nn_c4 = 0\nn_c2 = 0\nn_c0 = 0\n\nfor ai in a:\n    if ai%4 ==0:\n        n_c4 += 1\n    elif ai%2 ==0:\n        n_c2 += 1\n    else:\n        n_c0 += 1\nif n_c4>=n_c0 or (n_c4 == n_c0-1 and n_c4+n_c0 == N) :\n    print('Yes')\nelse:\n    print('No')\n", "passed": true, "time": 0.14, "memory": 14140.0, "status": "done"}, {"code": "N = int(input())\na = [int(i) for i in input().split()]\n\nki = 0\ngu_2 = 0\ngu_4 = 0\n\nfor i in a:\n    if i % 4 == 0:\n        gu_4 += 1\n    elif i % 2 == 0:\n        gu_2 += 1\n    else:\n        ki += 1\n\nif ki <= gu_4:\n    print('Yes')\nelse:\n    if gu_4 + 1 == ki and gu_4 + ki == N:\n        print('Yes')\n    else:\n        print('No')", "passed": true, "time": 0.14, "memory": 14092.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int,input().split()))\nli = [0,0,0]\nfor i in range(n):\n    if a[i]%4==0:\n        li[2] +=1\n        continue\n    elif a[i]%2==0:\n        li[1] +=1\n    else:\n        li[0] +=1\n#print(li)\n\nif li[0]==0:\n    print(\"Yes\")\nelif li[0]==1:\n    if li[2]>=1:\n        print(\"Yes\")\n    else:\n        print(\"No\")\nelse:\n    k = li[0]\n    if n>=2*k:\n        if li[2]>=k:\n            print(\"Yes\")\n        else:\n            print(\"No\")\n    elif n==2*k-1:\n        if li[2]>=k-1:\n            print(\"Yes\")\n        else:\n            print(\"No\")\n    else:\n        print(\"No\")\n    \n", "passed": true, "time": 0.14, "memory": 14248.0, "status": "done"}, {"code": "# 2 2 4 1 4 1\n# 1 4 1 2 2\nn = int(input())\na = list(map(int,input().split()))\ni2 = 0\ni4 = 0\nfor i in range(n):\n    if a[i]%4==0:\n        i4 += 1\n    if a[i]%2==0:\n        i2 += 1\n\nif n//2 <= i4:\n    print('Yes')\nelse:\n    tmp = n//2\n    if n%2==0:\n        if (tmp - i4) * 2 <= (i2 - i4):\n            print('Yes')\n        else:\n            print('No')\n    else:\n        if (tmp - i4) * 2 + 1 <= (i2 - i4):\n            print('Yes')\n        else:\n            print('No')\n", "passed": true, "time": 0.14, "memory": 14332.0, "status": "done"}, {"code": "N = int(input())\nA = list(map(int, input().split()))\ncnt = [0]*3\n\nfor x in A:\n  x %= 4\n  if x == 0:\n    cnt[2] += 1\n  elif x == 2:\n    cnt[1] += 1\n  else:\n    cnt[0] += 1\n\nif cnt[0] <= cnt[2] or ( cnt[1] == 0 and cnt[0] == cnt[2] + 1):\n  print(\"Yes\")\nelse:\n  print(\"No\")", "passed": true, "time": 0.22, "memory": 14236.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\n\nnum4 = 0\nnum2 = 0\nfor i in range(n):\n    if a[i]%4 == 0:\n        num4 += 1\n    elif a[i]%2 == 0:\n        num2 += 1\n\n#print(num4, num2)\n\n\n\nif n-num4*2 <= 1:\n    print(\"Yes\")\nelif n-num4*2 <= num2:\n    print(\"Yes\")\nelse:\n    print(\"No\")\n", "passed": true, "time": 0.14, "memory": 14360.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\nbai4 = []\nbai2 = []\nbai_ = []\nfor ai in a:\n    if ai % 4 == 0:\n        bai4.append(ai)\n    elif ai % 2 == 0:\n        bai2.append(ai)\n    else:\n        bai_.append(ai)\n\nlen_bai_ = len(bai_)\nlen_bai2 = len(bai2)\nlen_bai4 = len(bai4)\n\n\nif len_bai_ > len_bai4:\n    if len_bai_ == len_bai4 + 1 and n == len_bai_ + len_bai4:\n        print(\"Yes\")\n    else:\n        print(\"No\")\nelse:\n    print(\"Yes\")", "passed": true, "time": 0.14, "memory": 14116.0, "status": "done"}, {"code": "N = int(input())\nA = list(map(int,input().split()))\nX = [0,0,0]\n\nfor i in range(len(A)):\n  if A[i]%4 == 0:\n    X[2] += 1\n  elif A[i]%2 == 0:\n    X[1] += 1\n  else:\n    X[0] += 1\n\nif 2*X[2] + 1 >= N:\n  print(\"Yes\")\nelif 2*X[2] + X[1]>= N:\n  print(\"Yes\")\nelse:\n  print(\"No\")", "passed": true, "time": 0.14, "memory": 14328.0, "status": "done"}]