stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int n,a,b,x,c;

int main()

{

	scanf("%d",&n);

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

		scanf("%d",&x);

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

		else if(x&1)b++;

		else c++;

	}

	if(!c)b--;

	if(a>=b)puts("Yes");

	else puts("No");

	return 0;

}

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



int main()

{

	int n=0;

	scanf("%d",&n);

	int _4m=0,_2m=0,_1m=0;	

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

	{

		int input=0;

		scanf("%d",&input);

		if(input&1)

		{

			_1m++;

		}

		else if(input%4==0)

		{

			_4m++;

		}

		else

		{

			_2m++;

		}

	}

	if(_1m>_4m+1||(_1m==_4m+1&&_2m!=0)) printf("No\n");

    else printf("Yes\n");

	

	return 0;

}
// Slower C++ solution:
//周♂雨扬是最强的！！！

//大佬祝您AK

//沈哲♂贝是最强的！！！

#include<iostream>

#include<algorithm>

#include<cmath>

#include<cstring>

#include<fstream>

using namespace std;

//ifstream fin(.in);

//ofstream fout(.out);

int n,one,two,four;

int num[100003];

int main(){

	cin>>n;

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

        cin>>num[i];

        if(num[i]%4==0){

        	four++;

		}else if(num[i]%2==0){

        	two++;

		}else{

        	one++;

		}

    }

	if(one>four+1||(one==four+1&&two!=0)){

		cout<<"No"<<endl;

	}else{

		cout<<"Yes"<<endl;

	}

	return 0;

}

//沈♂哲贝是最强的！！！

//大佬祝您AK

//周♂雨扬是最强的！！！

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



int main()

{

	int n=0;

	scanf("%d",&n);

	int _4m=0,_2m=0,_1m=0;	

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

	{

		int input=0;

		scanf("%d",&input);

		if(input&1)

		{

			_1m++;

		}

		else if(input%4==0)

		{

			_4m++;

		}

		else

		{

			_2m++;

		}

	}

	if(_1m>_4m+1||(_1m==_4m+1&&_2m!=0)) printf("No\n");

    else printf("Yes\n");

	

	return 0;

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

#include <cstring>

#include <cmath>

#include <algorithm>

#include <iostream>

using namespace std;



#define rp(i,t) for(int i=0;i<(t);i++)

#define rep(i,s,t) for(int i=(s);i<=(t);i++)

#define rsp(i,s,t) for(int i=(s);i<(t);i++)

#define rrp(i,t,s) for(int i=(t);i>=(s);i--)

#define rcp(i,s,b,d) for(int i=(s);b;d)

#define mst(a,x) memset(a,x,sizeof(a))

#define INF 0x3f3f3f3f

#define N



#define Dp puts("")

#define Dw printf

#define Ds printf("#")



typedef long long ll;

char ch;

int n,x,sgl,two,four;



inline void read(int &x){x=0;do{ch=getchar();}while(ch<'0'||'9'<ch);do{x=x*10+ch-'0';ch=getchar();}while('0'<=ch&&ch<='9');}



int main(void)

{

	read(n);

	rep(i,1,n)

	{

		read(x);

		if((x&3)==0)four++;

		else if((x&1)==0)two++;

		else sgl++;

	}

	if(four==sgl-1&&two==0)puts("Yes");

	else if(four>=sgl)puts("Yes");

	else puts("No");

	return 0;

}


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



int main()

{

	int n=0;

	scanf("%d",&n);

	int _4m=0,_2m=0,_1m=0;	

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

	{

		int input=0;

		scanf("%d",&input);

		if(input&1)

		{

			_1m++;

		}

		else if(input%4==0)

		{

			_4m++;

		}

		else

		{

			_2m++;

		}

	}

	if(_1m>_4m+1||(_1m==_4m+1&&_2m!=0)) printf("No\n");

    else printf("Yes\n");

	

	return 0;

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

using namespace std;

int main()

{

	int n;

	cin >> n;

	int *a = new int[n];

	int tmp = 0;

	int r2 = 0, r4 = 0;

	while (n--)

		cin >> a[tmp++];

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

	{

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

			r4++;

		else

		{

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

				r2++;

		}

	}

	if(tmp%2==1)//jishu

		cout << ((2 * r4 + r2 >= tmp - 1) ? "Yes" : "No") << endl;

	else

		cout << ((2 * r4 + r2 >= tmp) ? "Yes" : "No") << endl;

	return 0;

}

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



int main()

{

	int n=0;

	scanf("%d",&n);

	int _4m=0,_2m=0,_1m=0;	

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

	{

		int input=0;

		scanf("%d",&input);

		if(input&1)

		{

			_1m++;

		}

		else if(input%4==0)

		{

			_4m++;

		}

		else

		{

			_2m++;

		}

	}

	if(_1m>_4m+1||(_1m==_4m+1&&_2m!=0)) printf("No\n");

    else printf("Yes\n");

	

	return 0;

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





using namespace std;





//1 * 4 or 2 * 2 网上思路

int main() {

	int n;

	scanf("%d", &n);

	int four = 0;

	int two = 0;

	int one = 0;

	int temp;

	while (n--) {

		scanf("%d", &temp);

		if(temp % 4 == 0) {

			four++;

		} else if(temp % 2 == 0) {

			two++;

		} else {

			one++;

		}

	}



	if(one > four + 1 || (one == four + 1 && two > 0)) {

		printf("No");

	} else {

		printf("Yes");

	}





	return 0;

}

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



int main()

{

	int n=0;

	scanf("%d",&n);

	int _4m=0,_2m=0,_1m=0;	

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

	{

		int input=0;

		scanf("%d",&input);

		if(input&1)

		{

			_1m++;

		}

		else if(input%4==0)

		{

			_4m++;

		}

		else

		{

			_2m++;

		}

	}

	if(_1m>_4m+1||(_1m==_4m+1&&_2m!=0)) printf("No\n");

    else printf("Yes\n");

	

	return 0;

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

using namespace std;



int main(){

    int n;

    cin>>n;

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

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

        int k;

        cin>>k;

        if(k%4==0)

            a++;

        else if(k%2==0)

            b++;

        else

            c++;

    }

    a-=c;

    if(a>=0||(a==-1&&b==0))

        cout<<"Yes"<<endl;

    else

        cout<<"No"<<endl;

    return 0;

}

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



int main()

{

	int n=0;

	scanf("%d",&n);

	int _4m=0,_2m=0,_1m=0;	

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

	{

		int input=0;

		scanf("%d",&input);

		if(input&1)

		{

			_1m++;

		}

		else if(input%4==0)

		{

			_4m++;

		}

		else

		{

			_2m++;

		}

	}

	if(_1m>_4m+1||(_1m==_4m+1&&_2m!=0)) printf("No\n");

    else printf("Yes\n");

	

	return 0;

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

#include<iostream>

using namespace std;

int main()

{

	int n;

	scanf("%d",&n);

	int *a=new int[n];

	int odd=0;

	int fou=0;

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

	{

		scanf("%d",a+i);

		if(a[i]&1!=0)

			odd++;

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

			fou++;

	}

	if(fou>=odd||(odd==fou+1&&odd+fou==n))

		printf("Yes");

	else

		printf("No");

	return 0;

}

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



int main()

{

	int n=0;

	scanf("%d",&n);

	int _4m=0,_2m=0,_1m=0;	

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

	{

		int input=0;

		scanf("%d",&input);

		if(input&1)

		{

			_1m++;

		}

		else if(input%4==0)

		{

			_4m++;

		}

		else

		{

			_2m++;

		}

	}

	if(_1m>_4m+1||(_1m==_4m+1&&_2m!=0)) printf("No\n");

    else printf("Yes\n");

	

	return 0;

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



using namespace std;



typedef long long ll;

typedef unsigned long long ull;

typedef pair<int, int> pii;

typedef vector<int> vi;

typedef vector<ll> vll;

typedef set<int> si;



int main()

{

    ios::sync_with_stdio(false);

    cin.tie(0);

    cout.tie(0);

    int n;

    int t;

    map<int, int> m;

    cin >> n;

    while (n--)

    {

        cin >> t;

        if (t % 4 == 0)

            m[4]++;

        else if (t & 1)

            m[1]++;

        else

            m[2]++;

    }

    if (m[1] <= m[4] || (m[1] <= m[4] + 1 && !m[2]))

        cout << "Yes" << endl;

    else

        cout << "No" << endl;

    return 0;

}

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



int main()

{

	int n=0;

	scanf("%d",&n);

	int _4m=0,_2m=0,_1m=0;	

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

	{

		int input=0;

		scanf("%d",&input);

		if(input&1)

		{

			_1m++;

		}

		else if(input%4==0)

		{

			_4m++;

		}

		else

		{

			_2m++;

		}

	}

	if(_1m>_4m+1||(_1m==_4m+1&&_2m!=0)) printf("No\n");

    else printf("Yes\n");

	

	return 0;

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

#include<cmath>

using namespace std;





int main(void)

{

	int n = 0;

	cin>>n;

	long long int a[n]={0};

	int four = 0;

	int two = 0;

	int oth = 0;

	int flag = 0;

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

		long long int h =0;

		cin>>h;

		a[k]=h;

	}

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

		if (a[j]%4 ==0) four++;

		else if (a[j]%2==0&&a[j]%4!=0) two++;

		else oth++;

	}

	if (two>0) flag = 1;

	if(flag+oth<=four+1) cout<<"Yes";

	else	cout<<"No";

	

	return 0;

}








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



int main()

{

	int n=0;

	scanf("%d",&n);

	int _4m=0,_2m=0,_1m=0;	

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

	{

		int input=0;

		scanf("%d",&input);

		if(input&1)

		{

			_1m++;

		}

		else if(input%4==0)

		{

			_4m++;

		}

		else

		{

			_2m++;

		}

	}

	if(_1m>_4m+1||(_1m==_4m+1&&_2m!=0)) printf("No\n");

    else printf("Yes\n");

	

	return 0;

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

#include <cstdio>

#include <cstdlib>

#include <algorithm>



using namespace std;



#define N 200008



int n;

int a[N];



int main()

{

	int four = 0, two = 0, one = 0;

	scanf("%d", &n);

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

	{

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

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

			four ++;

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

			two ++;

		else

			one ++;

	}

	if (one <= four)

		printf("Yes\n");

	else if (one == four + 1)

	{

		if (two == 0)

			printf("Yes\n");

		else

			printf("No\n");

	}

	else

		printf("No\n");

	return 0;

}

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



int main()

{

	int n=0;

	scanf("%d",&n);

	int _4m=0,_2m=0,_1m=0;	

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

	{

		int input=0;

		scanf("%d",&input);

		if(input&1)

		{

			_1m++;

		}

		else if(input%4==0)

		{

			_4m++;

		}

		else

		{

			_2m++;

		}

	}

	if(_1m>_4m+1||(_1m==_4m+1&&_2m!=0)) printf("No\n");

    else printf("Yes\n");

	

	return 0;

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

using namespace std;

int a[200005];

int main()

{

	int n, count1, count2;

	while (cin >> n)

	{

		int flag = 0;

		count1 = count2 = 0;

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

		{

			cin >> a[i];

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

				count1++;

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

				count2++;

		}

		if (count2 == count1 + 1 && count2 + count1 == n)    

			flag = 1;

		if (count1 >= count2)      

			flag = 1;

		if (flag)

			cout << "Yes" << endl;

		else

			cout << "No" << endl;

	}

	return 0;

}

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



int main()

{

	int n=0;

	scanf("%d",&n);

	int _4m=0,_2m=0,_1m=0;	

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

	{

		int input=0;

		scanf("%d",&input);

		if(input&1)

		{

			_1m++;

		}

		else if(input%4==0)

		{

			_4m++;

		}

		else

		{

			_2m++;

		}

	}

	if(_1m>_4m+1||(_1m==_4m+1&&_2m!=0)) printf("No\n");

    else printf("Yes\n");

	

	return 0;

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

#include<iostream>

#include<algorithm>

#define rep(i,l,p) for(int i=l;i<=p;i++)

using namespace std;



const int maxN = 1e6 + 10;

int n;

int ar[maxN];

int a,b,d;

int flag = 0;

void input(){

	scanf("%d",&n);

	rep(i,1,n){

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

		if ( ar[i] % 2 == 0){

			if(ar[i] % 4 == 0) d++;

			else b++;

		}else{

			a++;

		}

	}

}

void solve(){

	if (d>=a && b>0) flag = 1;

	else if ( (d+1)>=a && b==0 && d>0 ) flag = 1;

}

int main(){



	input();

	solve();

	//printf("a:%d\tb:%d\td:%d\n",a,b,d );

	if (flag == 0) printf("No\n");

	else printf("Yes\n");

	

	return 0;

}

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



int main()

{

	int n=0;

	scanf("%d",&n);

	int _4m=0,_2m=0,_1m=0;	

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

	{

		int input=0;

		scanf("%d",&input);

		if(input&1)

		{

			_1m++;

		}

		else if(input%4==0)

		{

			_4m++;

		}

		else

		{

			_2m++;

		}

	}

	if(_1m>_4m+1||(_1m==_4m+1&&_2m!=0)) printf("No\n");

    else printf("Yes\n");

	

	return 0;

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

using namespace std;

int main ()  

{  

    int n;  

    cin>>n;

    if(n>=2&&n<=100000)

	{

		int a=0,b=0,m,t;  

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

    	{  

        	cin>>t;

			if(t<1&&t>1000000000)

			goto loop;  

        	if(t%2==0)  

        	a++;  

        	if(t%4==0)  

        	b++;  

    	}  

    	m=a-b;  

    	if(n<=2*b+m&&m!=0)  

    	cout<<"Yes";  

    	else if(n<=2*b+1&&m==0)  

    	cout<<"Yes";  

    	else  

    	loop: cout<<"No";  

	}

    cout<<endl;

    return 0;

}  

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



int main()

{

	int n=0;

	scanf("%d",&n);

	int _4m=0,_2m=0,_1m=0;	

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

	{

		int input=0;

		scanf("%d",&input);

		if(input&1)

		{

			_1m++;

		}

		else if(input%4==0)

		{

			_4m++;

		}

		else

		{

			_2m++;

		}

	}

	if(_1m>_4m+1||(_1m==_4m+1&&_2m!=0)) printf("No\n");

    else printf("Yes\n");

	

	return 0;

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

using namespace std;



int main()

{

	int n;

	int a;//4

	int b;//2

	int c;//else

	while (cin >> n)

	{

		a = 0;

		b = 0;

		c = 0;

		int *p = new int[n];

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

		{

			cin >> p[i];

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

			{

				a++;

			}

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

			{

				b++;

			}

			else

			{

				c++;

			}

		}

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

		{

			cout << "Yes" << endl;

		}

		else

		{

			cout << "No" << endl;

		}

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

		{

			cout << p[i];

		}*/

		free(p);

	}



	return 0;

}

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



int main()

{

	int n=0;

	scanf("%d",&n);

	int _4m=0,_2m=0,_1m=0;	

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

	{

		int input=0;

		scanf("%d",&input);

		if(input&1)

		{

			_1m++;

		}

		else if(input%4==0)

		{

			_4m++;

		}

		else

		{

			_2m++;

		}

	}

	if(_1m>_4m+1||(_1m==_4m+1&&_2m!=0)) printf("No\n");

    else printf("Yes\n");

	

	return 0;

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

using namespace std;

long long int a[200000];

int main()

{

	int i,j,k,l;

	cin >> i;

	j = 0; k = 0; l = 0;

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

	{

		cin >> a[z];

		if (a[z] % 2 == 0 && a[z] % 4 == 0)

		{

			j++;

		}

		else if (a[z] % 2 == 0 && a[z] % 4 != 0)

		{

			k++;

		}

		else if (a[z] % 2 != 0)

		{

			l++;

		}

	}

	if (j + l == i&&j < l - 1)

	{

		cout << "No";

	}

	else if (j + l != i&&j < l)

	{

		cout << "No";

	}

	else

		cout << "Yes";

}

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



int main()

{

	int n=0;

	scanf("%d",&n);

	int _4m=0,_2m=0,_1m=0;	

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

	{

		int input=0;

		scanf("%d",&input);

		if(input&1)

		{

			_1m++;

		}

		else if(input%4==0)

		{

			_4m++;

		}

		else

		{

			_2m++;

		}

	}

	if(_1m>_4m+1||(_1m==_4m+1&&_2m!=0)) printf("No\n");

    else printf("Yes\n");

	

	return 0;

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

using namespace std;

int main()

{

	int a, b, c;

	int N;

	int num;

	while (cin >> N)

	{

		a = b = c = 0;

		while (N--)

		{

			cin >> num;

			if (num % 4 == 0) a++;

			else if (num % 2 == 0) b++;

			else c++;

		}

		if (b == 0)

		{

			if (a >= c - 1) cout << "Yes" << endl;

			else cout << "No" << endl;

			continue;

		}



		if (a >= c) cout << "Yes" << endl;

		else cout << "No" << endl;

	}



	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.292162860803934x):
#include<cstdio>

#include<cstring>

int main() {

	int n;

	long long tmp;

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

		int cnt0=0,cnt2=0,cnt4=0;



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

			scanf("%lld",&tmp);

			if(tmp%4==0)

				cnt4++;

			else if(tmp%2==0)

				cnt2++;

			else if(tmp%4!=0&&tmp%2!=0)cnt0++;

		}

		if(cnt4+1==cnt0&&cnt2!=0)

			printf("No\n");

		else if(cnt4+1<cnt0)

			printf("No\n");

		else printf("Yes\n");

	}

	return 0;

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

using namespace std;

int main()

{

	int a, b, c;

	int N;

	int num;

	while (cin >> N)

	{

		a = b = c = 0;

		while (N--)

		{

			cin >> num;

			if (num % 4 == 0) a++;

			else if (num % 2 == 0) b++;

			else c++;

		}

		if (b == 0)

		{

			if (a >= c - 1) cout << "Yes" << endl;

			else cout << "No" << endl;

			continue;

		}



		if (a >= c) cout << "Yes" << endl;

		else cout << "No" << endl;

	}



	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.386957610046202x):
#include<cstdio>

#include<cstring>

#include<algorithm>

#define ll long long

#define N 100005

#define mod 1000000007

#define rep(i,j,k) for (ll i=j;i<=k;++i)

#define per(i,j,k) for (ll i=j;i>=k;--i)

using namespace std;

inline ll read(){

	char ch=getchar(); ll x=0,f=1;

	while (ch<'0'||ch>'9') { if (ch=='-') f=-1; ch=getchar(); }

	while (ch>='0'&&ch<='9') { x=x*10+ch-'0'; ch=getchar(); }

	return x*f;

}

ll n,x,x0,x1,x2;

int main(){

	n=read();

	rep(i,1,n){

		x=read();

		if (x%2) ++x0;

		else if (!(x%4)) ++x2;

		else ++x1;

	}

	if (!x1) puts(x2>=x0-1?"Yes":"No");

	else puts(x2>=x0?"Yes":"No");

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

using namespace std;

int main() {

	int n, input, db4, db2, ndb2;

	cin >> n;

	int i;

	i = n;

	db4 = db2 = ndb2 = 0;

	while(i--) {

		cin >> input;

		if(input%4 == 0) db4++;

		else if(input&1) ndb2++;

		else db2++;

	}

	if(ndb2 == n) cout << "No";

	else if(db2+db4 == n) cout << "Yes";

	else if(db2+ndb2<=db4+1) cout << "Yes";

	else if(db4>=ndb2) cout << "Yes";

	else cout << "No";

}

// Faster C++ solution for the same problem (measured speedup: 5.3713735117073x):
#include<cstdio>

#include<cstring>

#include<algorithm>

#define ll long long

#define N 100005

#define mod 1000000007

#define rep(i,j,k) for (ll i=j;i<=k;++i)

#define per(i,j,k) for (ll i=j;i>=k;--i)

using namespace std;

inline ll read(){

	char ch=getchar(); ll x=0,f=1;

	while (ch<'0'||ch>'9') { if (ch=='-') f=-1; ch=getchar(); }

	while (ch>='0'&&ch<='9') { x=x*10+ch-'0'; ch=getchar(); }

	return x*f;

}

ll n,x,x0,x1,x2;

int main(){

	n=read();

	rep(i,1,n){

		x=read();

		if (x%2) ++x0;

		else if (!(x%4)) ++x2;

		else ++x1;

	}

	if (!x1) puts(x2>=x0-1?"Yes":"No");

	else puts(x2>=x0?"Yes":"No");

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

using namespace std;

int read(){

	char c=getchar();while (c!='-'&&(c<'0'||c>'9'))c=getchar();

	int kk=1,k=0;if (c=='-')kk=-1,c=getchar();

	while (c>='0'&&c<='9')k=k*10+c-'0',c=getchar();return kk*k;

}int n,x,y,xx,yy,zz;

int main(){

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

		x=read();y=0;while (x%2==0)x/=2,y++;

		if (y>=2)zz++;else if (y==0)xx++;else yy++;

	}if (yy){

		if (xx>zz)puts("No");else puts("Yes");

	}else if (xx>zz+1)puts("No");else puts("Yes");

}


// Faster C++ solution for the same problem (measured speedup: 5.294651796808087x):
#include<cstdio>

#include<cstring>

#include<algorithm>

#define ll long long

#define N 100005

#define mod 1000000007

#define rep(i,j,k) for (ll i=j;i<=k;++i)

#define per(i,j,k) for (ll i=j;i>=k;--i)

using namespace std;

inline ll read(){

	char ch=getchar(); ll x=0,f=1;

	while (ch<'0'||ch>'9') { if (ch=='-') f=-1; ch=getchar(); }

	while (ch>='0'&&ch<='9') { x=x*10+ch-'0'; ch=getchar(); }

	return x*f;

}

ll n,x,x0,x1,x2;

int main(){

	n=read();

	rep(i,1,n){

		x=read();

		if (x%2) ++x0;

		else if (!(x%4)) ++x2;

		else ++x1;

	}

	if (!x1) puts(x2>=x0-1?"Yes":"No");

	else puts(x2>=x0?"Yes":"No");

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

#define Ll long long

using namespace std;

const int N=2e5+5;

int n,m,x,y,c;

int main()

{

	scanf("%d",&n);

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

		cin>>c;m=0;

		if(c%2==0)m++;

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

		if(m==1)x++;

		if(m==2)y++;

	}

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

	if(y>=n-x-y)puts("Yes");else 

	if(!x&&y==n/2)puts("Yes");else puts("No");

}

// Faster C++ solution for the same problem (measured speedup: 5.344113779750775x):
#include<cstdio>

#include<cstring>

#include<algorithm>

#define ll long long

#define N 100005

#define mod 1000000007

#define rep(i,j,k) for (ll i=j;i<=k;++i)

#define per(i,j,k) for (ll i=j;i>=k;--i)

using namespace std;

inline ll read(){

	char ch=getchar(); ll x=0,f=1;

	while (ch<'0'||ch>'9') { if (ch=='-') f=-1; ch=getchar(); }

	while (ch>='0'&&ch<='9') { x=x*10+ch-'0'; ch=getchar(); }

	return x*f;

}

ll n,x,x0,x1,x2;

int main(){

	n=read();

	rep(i,1,n){

		x=read();

		if (x%2) ++x0;

		else if (!(x%4)) ++x2;

		else ++x1;

	}

	if (!x1) puts(x2>=x0-1?"Yes":"No");

	else puts(x2>=x0?"Yes":"No");

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

using namespace std;

int n,x,c1,c2,c4;

int main(){

	scanf("%d",&n);

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

		scanf("%d",&x);

		if (x&1) c1++;

		else if (x%4) c2++;

		else c4++;

	}

	puts(c4>=c1+(c2!=0)-1?"Yes":"No");

}

// Faster C++ solution for the same problem (measured speedup: 5.31313105419979x):
#include<cstdio>

#include<cstring>

#include<algorithm>

#define ll long long

#define N 100005

#define mod 1000000007

#define rep(i,j,k) for (ll i=j;i<=k;++i)

#define per(i,j,k) for (ll i=j;i>=k;--i)

using namespace std;

inline ll read(){

	char ch=getchar(); ll x=0,f=1;

	while (ch<'0'||ch>'9') { if (ch=='-') f=-1; ch=getchar(); }

	while (ch>='0'&&ch<='9') { x=x*10+ch-'0'; ch=getchar(); }

	return x*f;

}

ll n,x,x0,x1,x2;

int main(){

	n=read();

	rep(i,1,n){

		x=read();

		if (x%2) ++x0;

		else if (!(x%4)) ++x2;

		else ++x1;

	}

	if (!x1) puts(x2>=x0-1?"Yes":"No");

	else puts(x2>=x0?"Yes":"No");

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

using namespace std;

int main()

{

	int a, b, c;

	int N;

	int num;

	while (cin >> N)

	{

		a = b = c = 0;

		while (N--)

		{

			cin >> num;

			if (num % 4 == 0) a++;

			else if (num % 2 == 0) b++;

			else c++;

		}

		if (b == 0)

		{

			if (a >= c - 1) cout << "Yes" << endl;

			else cout << "No" << endl;

			continue;

		}



		if (a >= c) cout << "Yes" << endl;

		else cout << "No" << endl;

	}



	return 0;

}

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



const int max=100000+5;



int main(){

	int a[max]={0};

	int n,one=0,two=0,four=0,flag=0;

	

	scanf("%d",&n);

	

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

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

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

			four++;

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

			two++;

		else

			one++;

	} 

	

	if(two==0){

		if(four>=one-1)

			flag=1;

	}

	else{

		if(four>=one)

			flag=1;

	}

	

	if(flag==1)

		printf("Yes");

	else

		printf("No");

		

	return 0;

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

using namespace std;

int main() {

	int n, input, db4, db2, ndb2;

	cin >> n;

	int i;

	i = n;

	db4 = db2 = ndb2 = 0;

	while(i--) {

		cin >> input;

		if(input%4 == 0) db4++;

		else if(input&1) ndb2++;

		else db2++;

	}

	if(ndb2 == n) cout << "No";

	else if(db2+db4 == n) cout << "Yes";

	else if(db2+ndb2<=db4+1) cout << "Yes";

	else if(db4>=ndb2) cout << "Yes";

	else cout << "No";

}

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



const int max=100000+5;



int main(){

	int a[max]={0};

	int n,one=0,two=0,four=0,flag=0;

	

	scanf("%d",&n);

	

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

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

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

			four++;

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

			two++;

		else

			one++;

	} 

	

	if(two==0){

		if(four>=one-1)

			flag=1;

	}

	else{

		if(four>=one)

			flag=1;

	}

	

	if(flag==1)

		printf("Yes");

	else

		printf("No");

		

	return 0;

}