stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include<iostream>

#include<algorithm>

using namespace std;

const int maxn=1e5+5;

int n;

long long a[maxn];

int main(){

	cin>>n;

	//long long x,sum=1;

	//bool f=1;

	for(int i=0;i<n;i++)cin>>a[i];

	int x=0,y=0,z=0;

	for(int i=0;i<n;i++){

		if(a[i]%4==0)x++;

		else if(a[i]%2==0)y++,z++;

		else z++;

	}

	//cout<<x<<' '<<y<<' '<<z<<endl;

	if(z==y)cout<<"Yes"<<endl;

	else{

		if(y%2==0)z-=y;

		else z=z-y+1;

		if(x>=z-1)cout<<"Yes"<<endl;

		else cout<<"No"<<endl;

	}

	//else if(x>=z-y/2-1)cout<<"Yes"<<endl;

	//else cout<<"No"<<endl;

	/*for(int i=n-1;i>=0;i--){

		sum*=x;

		if(sum%4){

			cout<<"No"<<endl;

			f=0;

			break;

		}

		sum%=4;

	}

	if(f)cout<<"Yes"<<endl;*/

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.310109563156404x):
#include<stdio.h>

using namespace std;

int main()

{

    int a=0,b=0,c=0;//a奇数，b能被4整除，c被2整除

    int n;

    while(~scanf("%d",&n)){

            a=0,b=0,c=0;

    int s;

    while(n--)

    {

        scanf("%d",&s);

        if(s%2==1)

            a++;

        else

        {

            if(s%4==0)

                b++;

            else

                c++;

        }

    }

    if(a>b+1||(a==b+1&&c!=0))

        printf("No\n");

    else

         printf("Yes\n");

    }

        return 0;

}
// Slower C++ solution:
#include<iostream>

#include<stdio.h>

#include<string>

#include<cmath>

#include<algorithm>

using namespace std;

const int maxn=100005;

const int mod=1000007;

const double eps=1e-3;

struct node

{

        int data;

        int cnt;

        bool operator < (const node &s) const

        {

                        return cnt<s.cnt;

        }

}a[maxn];

int main()

{

        int temp,n;

        bool f=false;

        bool if1=false;

        bool if0=false;

        while(cin>>n)

        {

                int cnt0=0;

                int cnt2=0;

                f=false;

                if0=false;

                if1=false;

                bool exist1=false;

                for(int i=0;i<n;i++)

                {

                        scanf("%d",&a[i].data);

                        a[i].cnt=0;

                        temp=a[i].data;

                        while(temp%2==0)

                        {

                                a[i].cnt++;

                                temp>>=1;

                                //cout<<temp<<' '<<a[i].cnt<<endl;

                                if(a[i].cnt>=2) break;

                        }

                        if(a[i].cnt==0)

                        {

                                cnt0++;

                        }

                        if(a[i].cnt==2)

                        {

                                cnt2++;

                        }

                        if(a[i].cnt==1)

                        {

                                exist1=true;

                        }

                        //cout<<cnt0<<' '<<cnt2<<' '<<exist1<<endl;

                }

                //cout<<cnt0<<' '<<cnt2<<' '<<exist1<<endl;

                if((cnt2<cnt0-1)||(cnt2==cnt0-1&&exist1))

                        printf("No\n");

                else

                {

                        printf("Yes\n");

                }

        }

	//system("pause");

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.294694781993495x):
#include<stdio.h>

using namespace std;

int main()

{

    int a=0,b=0,c=0;//a奇数，b能被4整除，c被2整除

    int n;

    while(~scanf("%d",&n)){

            a=0,b=0,c=0;

    int s;

    while(n--)

    {

        scanf("%d",&s);

        if(s%2==1)

            a++;

        else

        {

            if(s%4==0)

                b++;

            else

                c++;

        }

    }

    if(a>b+1||(a==b+1&&c!=0))

        printf("No\n");

    else

         printf("Yes\n");

    }

        return 0;

}
// Slower C++ solution:
#include <iostream>

#include <cstdio>

#include <cstring>

#include <algorithm>

#include <vector>

using namespace std;

#define LL long long



int n, num2;

int num4;

int a[100005];



int main()

{

    while(~scanf("%d", &n))

    {

        num2 = 0, num4 = 0;

        for(int i = 1; i <= n; ++i)

        {

            scanf("%d", &a[i]);

            if(a[i] % 2 == 0 && a[i] % 4 != 0) num2++;

            if(a[i] % 4 == 0) num4++;

        }

        if(num2 + num4 == n)

        {

            printf("Yes\n");

            continue;

        }

        if(num2 >= 2)

        {

            n -= num2;

            if(n % 2 == 1) n++;

        }

        if(num4 >= n / 2)

        {

            printf("Yes\n");

            continue;

        }

        printf("No\n");

    }

}


// Faster C++ solution for the same problem (measured speedup: 5.271773582331068x):
#include<stdio.h>

using namespace std;

int main()

{

    int a=0,b=0,c=0;//a奇数，b能被4整除，c被2整除

    int n;

    while(~scanf("%d",&n)){

            a=0,b=0,c=0;

    int s;

    while(n--)

    {

        scanf("%d",&s);

        if(s%2==1)

            a++;

        else

        {

            if(s%4==0)

                b++;

            else

                c++;

        }

    }

    if(a>b+1||(a==b+1&&c!=0))

        printf("No\n");

    else

         printf("Yes\n");

    }

        return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;



int n,a[100010],sum1,sum2,cnt1,cnt2;



int main()

{

	cin>>n;

	for(int i=0;i<n;i++)

	{

		cin>>a[i];

		if(a[i]%4==0) sum1++;

		if(a[i]%4==1||a[i]%4==3) sum2++;

		if(a[i]%4==2) cnt1++;

		if(a[i]==2) cnt2++;

		

	}

	sum1+=cnt2/2;

	if(sum1+1>=sum2+min(1,cnt1)) cout<<"Yes"; else cout<<"No";

	

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.28544299759804x):
#include<stdio.h>

int main()

{

	int n;

	while (scanf("%d", &n) != EOF)

	{

		int four = 0, two = 0,x=0;

		int a;

		while (n--)

		{

			scanf("%d", &a);

			if (a % 4==0)

			{

				four++;

				continue;

			}

			if (a % 2 == 0)

			{

				two++;

				continue;

			}

			x++;

		}

		if (two)

			x++;

		if (four + 1 < x)

			printf("No\n");

		else

			printf("Yes\n");

	}

	return 0;

}
// Slower C++ solution:
/*

×¢Òâ·¶Î§£¡

short·¶Î§£º-32768~32767

unsigned short·¶Î§£º0~65535

int·¶Î§£º-2147483648~2147483647

uint·¶Î§£º0~4294967295

INT·¶Î§£º-9223372036854775808~9223372036854775807

UINT·¶Î§£º0~18446744073709551615

float·¶Î§£º-3.4e38~3.4e38£¬¾«¶È£º6~7Î»

double·¶Î§£º-1.7e308~1.7e308£¬¾«¶È£º15~16Î»

ldouble·¶Î§£º-1.2e4932~1.2e4932£¬¾«¶È£º18~19Î»

*/

#include <algorithm>

#include <bitset>

#include <cassert>

#include <cctype>

#include <cmath>

#include <complex>

#include <cstdio>

#include <cstdlib>

#include <cstring>

#include <ctime>

#include <deque>

#include <fstream>

#include <functional>

#include <iomanip>

#include <iostream>

#include <list>

#include <map>

#include <numeric>

#include <queue>

#include <set>

#include <sstream>

#include <stack>

#include <string>

#include <utility>

#include <vector>

#define LL long long

#define pb push_back

#define pob pop_back

#define mp make_pair

#define FILL(a,v) memset((void*)a,v,sizeof(a))

#define FILL0(a) FILL(a,0)

#define FILL1(a) FILL(a,-1)

#define ALL(a) (a).begin(),(a).end()

#define Inf 1e9

#define Mod 1000000007

#define foreach(it,x) for(typeof(x.begin()) it=x.begin();it!=x.end();it++)

#define FOR(i,x) for(int i=0;i<x;i++)

#define RFOR(i,x) for(int i=x-1;i>=0;i--)

#define FFOR(i,a,b) for(int i=a;i<b;i++)

#define FRFOR(i,a,b) for(int i=a-1;i>=b;i--)

#define SZ(a) ((int)(a).size())

#define FI first

#define SE second

#define OVER(a) return puts(a),0

#define fastio ios::sync_with_stdio(0)

#define filei(f) freopen(f,"r",stdin)

#define fileo(f) freopen(f,"w",stdout)

using namespace std;

typedef pair<int,int> pii;

typedef unsigned long long UINT;

typedef unsigned int Uint;

typedef long long INT;

typedef pair<INT,INT> PII;

typedef vector<int> vint;

typedef vector<INT> VINT;

typedef vector<pii> vpii;

typedef vector<PII> VPII;

typedef greater<int> gint;

typedef greater<INT> GINT;

typedef greater<pii> gpii;

typedef greater<PII> GPII;



int n,a[100007],mn[4];



int main()

{

	scanf("%d",&n);

	for(int i=0;i<n;i++)

	{

		scanf("%d",&a[i]);

		a[i]%=4;

		mn[a[i]]++;

	}

	if(mn[1]+mn[3]<=mn[0])OVER("Yes");

	else if(mn[1]+mn[3]+mn[0]==n&&mn[1]+mn[3]<=mn[0]+1)OVER("Yes");

	else OVER("No");

}

// Faster C++ solution for the same problem (measured speedup: 5.226077951672989x):
#include<stdio.h>

int main()

{

	int n;

	while (scanf("%d", &n) != EOF)

	{

		int four = 0, two = 0,x=0;

		int a;

		while (n--)

		{

			scanf("%d", &a);

			if (a % 4==0)

			{

				four++;

				continue;

			}

			if (a % 2 == 0)

			{

				two++;

				continue;

			}

			x++;

		}

		if (two)

			x++;

		if (four + 1 < x)

			printf("No\n");

		else

			printf("Yes\n");

	}

	return 0;

}
// Slower C++ solution:
#include<iostream>

using namespace std;

int a[100010];

int num[100010];



int main()

{

	int l,r,i,j,n;

	int x0=0,x1=0,x2=0;

	ios::sync_with_stdio(false);

	cin>>n;

	for(i=0;i<n;i++)

	{

		cin>>a[i];

		while(a[i]%2==0&&a[i]!=0)

		{

			a[i]/=2;

			num[i]++;

		}

		if(num[i]==0) x0++;

		else if(num[i]==1) x1++;

		else x2++;

	}

	l=x0;

	if(x1>0) l++;

	r=x2;

	if(r+1>=l) cout<<"Yes\n";

	else cout<<"No\n";

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.359316235258511x):
#include<stdio.h>

int main()

{

	int n;

	while (scanf("%d", &n) != EOF)

	{

		int four = 0, two = 0,x=0;

		int a;

		while (n--)

		{

			scanf("%d", &a);

			if (a % 4==0)

			{

				four++;

				continue;

			}

			if (a % 2 == 0)

			{

				two++;

				continue;

			}

			x++;

		}

		if (two)

			x++;

		if (four + 1 < x)

			printf("No\n");

		else

			printf("Yes\n");

	}

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;



const int maxn = 1e5 + 7;

int main(){

    int n, num2 = 0, num4 = 0;

    scanf("%d", &n);

    for(int i = 0; i < n; i++){

        int x;

        scanf("%d", &x);

        if(x % 4 == 0) num4++;

        if(x % 2 == 0) num2++;

    }

    num2 -= num4;

    if(num2 > 0)

    n -= num2 - 1;

    if(num4 >= n / 2) puts("Yes");

    else puts("No");

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.224886615343759x):
#include<stdio.h>

int main()

{

	int n;

	while (scanf("%d", &n) != EOF)

	{

		int four = 0, two = 0,x=0;

		int a;

		while (n--)

		{

			scanf("%d", &a);

			if (a % 4==0)

			{

				four++;

				continue;

			}

			if (a % 2 == 0)

			{

				two++;

				continue;

			}

			x++;

		}

		if (two)

			x++;

		if (four + 1 < x)

			printf("No\n");

		else

			printf("Yes\n");

	}

	return 0;

}
// Slower C++ solution:
#include <iostream>

#include <cstring>

using namespace std;



int mp[3];

int n, x;



int main() {

	ios::sync_with_stdio(false);

	while (cin >> n) {

		memset(mp, 0, sizeof(mp));

		for (int i = 0; i < n; i++) {

			cin >> x;

			if (x % 4 == 0)

				mp[2]++;

			else if (x % 2 == 0)

				mp[1]++;

			else

				mp[0]++;

		}

		if (mp[1] > 0)

			mp[0]++;

		if (mp[0] - 1 > mp[2])

			cout << "No\n";

		else

			cout << "Yes\n";

	}

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.351270635117272x):
#include<stdio.h>

int main()

{

	int n;

	while (scanf("%d", &n) != EOF)

	{

		int four = 0, two = 0,x=0;

		int a;

		while (n--)

		{

			scanf("%d", &a);

			if (a % 4==0)

			{

				four++;

				continue;

			}

			if (a % 2 == 0)

			{

				two++;

				continue;

			}

			x++;

		}

		if (two)

			x++;

		if (four + 1 < x)

			printf("No\n");

		else

			printf("Yes\n");

	}

	return 0;

}
// Slower C++ solution:
#include <algorithm>

#include <iostream>

#include <string.h>

#include <stdio.h>

using namespace std;



int a[100005];



int main()

{

    int n , x, y;

    cin >> n;

    bool flag = false;

    x = y = 0;

    for(int i = 0; i < n; i++) cin>>a[i];

    for(int i = 0; i < n; i++)

    {

        if(a[i] % 4 == 0)

            x++;

        else if(a[i] % 2 == 0)

            y++;

        if(x * 2 + y >= n || x >= n / 2)

            flag = true;

    }

    if(flag) puts("Yes");

    else puts("No");

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.227530402814105x):
#include<stdio.h>

int main()

{

	int n;

	while (scanf("%d", &n) != EOF)

	{

		int four = 0, two = 0,x=0;

		int a;

		while (n--)

		{

			scanf("%d", &a);

			if (a % 4==0)

			{

				four++;

				continue;

			}

			if (a % 2 == 0)

			{

				two++;

				continue;

			}

			x++;

		}

		if (two)

			x++;

		if (four + 1 < x)

			printf("No\n");

		else

			printf("Yes\n");

	}

	return 0;

}
// Slower C++ solution:
#include <iostream>



using namespace std;

int a[100005];

int main()

{

    int N;

    while(cin>>N)

    {

        int mo2=0;

        int mo1=0;

        int mo4=0;

        for(int i=0;i<N;i++)

        {

            cin>>a[i];

            if(a[i]%4==0)

            {

                mo4++;

            }

            else

            {

                if(a[i]%2==0)

                    mo2++;

                else

                    mo1++;

            }

        }

        if(mo2!=0)

        {

            mo1++;

        }

        if(mo4>=mo1-1)

        {

            cout<<"Yes"<<endl;

        }

        else

        {

            cout<<"No"<<endl;

        }



    }

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.297844467555743x):
#include<stdio.h>

int main()

{

	int n;

	while (scanf("%d", &n) != EOF)

	{

		int four = 0, two = 0,x=0;

		int a;

		while (n--)

		{

			scanf("%d", &a);

			if (a % 4==0)

			{

				four++;

				continue;

			}

			if (a % 2 == 0)

			{

				two++;

				continue;

			}

			x++;

		}

		if (two)

			x++;

		if (four + 1 < x)

			printf("No\n");

		else

			printf("Yes\n");

	}

	return 0;

}
// Slower C++ solution:
#include<iostream>

using namespace std;

int main()

{

    int n;

    while (~scanf("%d", &n))

    {

        int cnte = 0, cnt4 = 0, cnt2 = 0;

        for (int i = 1; i <= n; i++)

        {

            int num;

            scanf("%d", &num);

            if (num % 2) cnte++;

            else if (num % 4) cnt2++;

            else cnt4++;

        }

        if (cnt2 == 0)

        {

            if (cnt4 >= cnte - 1)printf("Yes\n");

            else printf("No\n");

        }

        else if(cnt4>=cnte)printf("Yes\n");

        else printf("No\n");

    }

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.231892207058111x):
#include<stdio.h>

int main()

{

	int n;

	while (scanf("%d", &n) != EOF)

	{

		int four = 0, two = 0,x=0;

		int a;

		while (n--)

		{

			scanf("%d", &a);

			if (a % 4==0)

			{

				four++;

				continue;

			}

			if (a % 2 == 0)

			{

				two++;

				continue;

			}

			x++;

		}

		if (two)

			x++;

		if (four + 1 < x)

			printf("No\n");

		else

			printf("Yes\n");

	}

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

#define max(a,b) ((a>b)?(a):(b))

#define min(a,b) ((a<b)?(a):(b))

#define MEM(a,b) memset(a,b,sizeof(a))

using namespace std;

typedef long long LL;

typedef pair<int,int>pii;

const int mod = 1e9 + 7;

int a[200200];

int main() {

    int n, x;

    scanf("%d", &n);

    int four = 0;

    int two = 0;

    int not_four = 0;

    for(int i = 0; i < n; ++ i) {

        scanf("%d", &x);

        if(x % 2 == 0 && x % 4 != 0) two++;

        else if(x % 4 == 0) four++;

        else not_four++;

    }

    if(two == 0) {

        if(four + 1 < not_four) puts("No");

        else puts("Yes");

    } else {

        if(four < not_four) puts("No");

        else puts("Yes");

    }

}


// Faster C++ solution for the same problem (measured speedup: 5.267409755902159x):
#include<stdio.h>

int main()

{

	int n;

	while (scanf("%d", &n) != EOF)

	{

		int four = 0, two = 0,x=0;

		int a;

		while (n--)

		{

			scanf("%d", &a);

			if (a % 4==0)

			{

				four++;

				continue;

			}

			if (a % 2 == 0)

			{

				two++;

				continue;

			}

			x++;

		}

		if (two)

			x++;

		if (four + 1 < x)

			printf("No\n");

		else

			printf("Yes\n");

	}

	return 0;

}
// Slower C++ solution:
#include<iostream>

using namespace std;

int main(){

	int n,m,count,c2;

	while (cin>>n){

		count=0;

		c2=0;

	    for (int i=0;i<n;i++){

	    	cin>>m;

	    	if (m%4==0)count++;

	    	if (m%2==0&&m/2%2!=0)c2++;

		}

		   int c1=n-count-c2;

		   if ((c2&&count>=c1)||(c2==0&&count>=c1-1))cout<<"Yes"<<endl;

		   else cout<<"No"<<endl;

	}

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.297587803564514x):
#include<stdio.h>

int main()

{

	int n;

	while (scanf("%d", &n) != EOF)

	{

		int four = 0, two = 0,x=0;

		int a;

		while (n--)

		{

			scanf("%d", &a);

			if (a % 4==0)

			{

				four++;

				continue;

			}

			if (a % 2 == 0)

			{

				two++;

				continue;

			}

			x++;

		}

		if (two)

			x++;

		if (four + 1 < x)

			printf("No\n");

		else

			printf("Yes\n");

	}

	return 0;

}
// Slower C++ solution:
#include<iostream>

#include<algorithm>

using namespace std;

const int maxn=1e5+5;

int n;

long long a[maxn];

int main(){

	cin>>n;

	//long long x,sum=1;

	//bool f=1;

	for(int i=0;i<n;i++)cin>>a[i];

	int x=0,y=0,z=0;

	for(int i=0;i<n;i++){

		if(a[i]%4==0)x++;

		else if(a[i]%2==0)y++,z++;

		else z++;

	}

	//cout<<x<<' '<<y<<' '<<z<<endl;

	if(z==y)cout<<"Yes"<<endl;

	else{

		if(y%2==0)z-=y;

		else z=z-y+1;

		if(x>=z-1)cout<<"Yes"<<endl;

		else cout<<"No"<<endl;

	}

	//else if(x>=z-y/2-1)cout<<"Yes"<<endl;

	//else cout<<"No"<<endl;

	/*for(int i=n-1;i>=0;i--){

		sum*=x;

		if(sum%4){

			cout<<"No"<<endl;

			f=0;

			break;

		}

		sum%=4;

	}

	if(f)cout<<"Yes"<<endl;*/

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.311606405027647x):
#include<stdio.h>

int main()

{

	int n;

	while (scanf("%d", &n) != EOF)

	{

		int four = 0, two = 0,x=0;

		int a;

		while (n--)

		{

			scanf("%d", &a);

			if (a % 4==0)

			{

				four++;

				continue;

			}

			if (a % 2 == 0)

			{

				two++;

				continue;

			}

			x++;

		}

		if (two)

			x++;

		if (four + 1 < x)

			printf("No\n");

		else

			printf("Yes\n");

	}

	return 0;

}
// Slower C++ solution:
#include<iostream>

#include<stdio.h>

#include<string>

#include<cmath>

#include<algorithm>

using namespace std;

const int maxn=100005;

const int mod=1000007;

const double eps=1e-3;

struct node

{

        int data;

        int cnt;

        bool operator < (const node &s) const

        {

                        return cnt<s.cnt;

        }

}a[maxn];

int main()

{

        int temp,n;

        bool f=false;

        bool if1=false;

        bool if0=false;

        while(cin>>n)

        {

                int cnt0=0;

                int cnt2=0;

                f=false;

                if0=false;

                if1=false;

                bool exist1=false;

                for(int i=0;i<n;i++)

                {

                        scanf("%d",&a[i].data);

                        a[i].cnt=0;

                        temp=a[i].data;

                        while(temp%2==0)

                        {

                                a[i].cnt++;

                                temp>>=1;

                                //cout<<temp<<' '<<a[i].cnt<<endl;

                                if(a[i].cnt>=2) break;

                        }

                        if(a[i].cnt==0)

                        {

                                cnt0++;

                        }

                        if(a[i].cnt==2)

                        {

                                cnt2++;

                        }

                        if(a[i].cnt==1)

                        {

                                exist1=true;

                        }

                        //cout<<cnt0<<' '<<cnt2<<' '<<exist1<<endl;

                }

                //cout<<cnt0<<' '<<cnt2<<' '<<exist1<<endl;

                if((cnt2<cnt0-1)||(cnt2==cnt0-1&&exist1))

                        printf("No\n");

                else

                {

                        printf("Yes\n");

                }

        }

	//system("pause");

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.296187278664398x):
#include<stdio.h>

int main()

{

	int n;

	while (scanf("%d", &n) != EOF)

	{

		int four = 0, two = 0,x=0;

		int a;

		while (n--)

		{

			scanf("%d", &a);

			if (a % 4==0)

			{

				four++;

				continue;

			}

			if (a % 2 == 0)

			{

				two++;

				continue;

			}

			x++;

		}

		if (two)

			x++;

		if (four + 1 < x)

			printf("No\n");

		else

			printf("Yes\n");

	}

	return 0;

}
// Slower C++ solution:
#include <iostream>

#include <cstdio>

#include <cstring>

#include <algorithm>

#include <vector>

using namespace std;

#define LL long long



int n, num2;

int num4;

int a[100005];



int main()

{

    while(~scanf("%d", &n))

    {

        num2 = 0, num4 = 0;

        for(int i = 1; i <= n; ++i)

        {

            scanf("%d", &a[i]);

            if(a[i] % 2 == 0 && a[i] % 4 != 0) num2++;

            if(a[i] % 4 == 0) num4++;

        }

        if(num2 + num4 == n)

        {

            printf("Yes\n");

            continue;

        }

        if(num2 >= 2)

        {

            n -= num2;

            if(n % 2 == 1) n++;

        }

        if(num4 >= n / 2)

        {

            printf("Yes\n");

            continue;

        }

        printf("No\n");

    }

}


// Faster C++ solution for the same problem (measured speedup: 5.273259617852538x):
#include<stdio.h>

int main()

{

	int n;

	while (scanf("%d", &n) != EOF)

	{

		int four = 0, two = 0,x=0;

		int a;

		while (n--)

		{

			scanf("%d", &a);

			if (a % 4==0)

			{

				four++;

				continue;

			}

			if (a % 2 == 0)

			{

				two++;

				continue;

			}

			x++;

		}

		if (two)

			x++;

		if (four + 1 < x)

			printf("No\n");

		else

			printf("Yes\n");

	}

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;



typedef map<int,int>mpii;



#define fast ios_base::sync_with_stdio(0)



int main()

{

    fast;

    // let odd = b1, even not divisible by 4 = b2, divisible by 4 = b4

    int x, i , N , b4=0 , b2=0, b1=0;

    cin >> N;

    for(i=0; i<N; i++)

    {

        cin >> x;



        if(x % 4 == 0) b4++;

        else if(x % 2 == 0) b2+=1;

        else if(x % 2 != 0) b1+=1;

    }



    if(b2 == 0)

    {

        if(b1 <= b4+1) cout << "Yes\n";

        else cout << "No\n";

    }



    if(b2 > 0)

    {

        if(b1 <= b4) cout << "Yes\n";

        else cout << "No\n";

    }



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.355850529573478x):
#include<stdio.h>

int main()

{

	int n;

	while (scanf("%d", &n) != EOF)

	{

		int four = 0, two = 0,x=0;

		int a;

		while (n--)

		{

			scanf("%d", &a);

			if (a % 4==0)

			{

				four++;

				continue;

			}

			if (a % 2 == 0)

			{

				two++;

				continue;

			}

			x++;

		}

		if (two)

			x++;

		if (four + 1 < x)

			printf("No\n");

		else

			printf("Yes\n");

	}

	return 0;

}