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

using namespace std ;

int cnt , cnt4 , cnt2 ;

int main()

{

	int n ;

	cin >> n ;

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

	{

		int x ;

		cin >> x ;

		x = x % 4 ;

		if ( x == 0 ) 

			cnt4 ++  ;

		else if ( x == 2 ) 

			cnt2 ++ ;

	}

	int cnt = n-cnt2-cnt4 ;

	if ( cnt2 ) 

	{

		if ( cnt4 >= cnt ) 

			return cout<<"Yes\n" , 0 ;



	}

	else

	{

		if ( cnt4 && ( cnt4+1 >= cnt )) 

			return cout << "Yes\n" , 0 ;



	}

	cout << "No" << "\n" ;

}

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



int main(void)

{

	int a1count=0,a2count=0,a4count=0;

	int i,N,x;

	scanf("%d",&N);

	while(N--)

	{

		scanf("%d",&x);

		if(x%4==0)

			a4count++;

		else if(x%2==0)

			a2count++;

		else

			a1count++;

	}

	if(a2count>0 && a1count<=a4count)

		printf("Yes\n");

	else if(a2count==0 && a1count<=a4count+1)

		printf("Yes\n");

	else

		printf("No\n");



	return 0;

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

#include <algorithm>

#include <cstring>

#include <stdio.h>

#include <cstring>

#include <string.h>

using namespace std;



int main()

{

		int n;

		cin >> n;

		int four = 0, two = 0;

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

		{

			int x;

			cin >> x;

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

			else if (x % 2 == 0) two++;

		}

		two = max(two - 1, 0);

		if (four * 2 + two >= n - 1)

			cout << "Yes" << endl;

		else cout << "No" << endl;

}

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



int main(void)

{

	int a1count=0,a2count=0,a4count=0;

	int i,N,x;

	scanf("%d",&N);

	while(N--)

	{

		scanf("%d",&x);

		if(x%4==0)

			a4count++;

		else if(x%2==0)

			a2count++;

		else

			a1count++;

	}

	if(a2count>0 && a1count<=a4count)

		printf("Yes\n");

	else if(a2count==0 && a1count<=a4count+1)

		printf("Yes\n");

	else

		printf("No\n");



	return 0;

}
// Slower C++ solution:
//AZ@RK2019

//I know it wll accepted in first go! 

#include <bits/stdc++.h>

#include <iostream>

#include <set>

#include <vector>

#include <map>

#include <queue>

#include <algorithm>

using namespace std;

const int N = 2e5+7;

int n,a,one,two,four;

int main(){

	cin >> n;

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

		cin >> a; 

		if (a%4 == 0){

			four++;

		}

		else if(a%2 == 0){

			two++;

		}

		else{

			one++;

		}

	}

	if(four == one-1){

		if(two){

			cout << "No";

		}

		else{

			cout << "Yes";

		}

	}

	else if(four >= one){

		cout << "Yes";

	}

	else{

		cout << "No";

	}

	

	return 0;

}

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



int main(void)

{

	int a1count=0,a2count=0,a4count=0;

	int i,N,x;

	scanf("%d",&N);

	while(N--)

	{

		scanf("%d",&x);

		if(x%4==0)

			a4count++;

		else if(x%2==0)

			a2count++;

		else

			a1count++;

	}

	if(a2count>0 && a1count<=a4count)

		printf("Yes\n");

	else if(a2count==0 && a1count<=a4count+1)

		printf("Yes\n");

	else

		printf("No\n");



	return 0;

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

using namespace std;

const int N = 1e5 + 20;

typedef long long ll;

ll n, a[N], c[10], d = 0;

int main(){

	cin >> n;

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

		cin >> a[i];

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

			a[i] = 2;

			c[0] += 1;

		}

		else if(a[i] % 4 == 2){

			a[i] = 1;

			c[1] += 1;

		}

		else{

			a[i] = 0;

			c[2] += 1;

		}

	}

	if(c[1] != 0){

		if(c[2] > c[0]){

			d = 1;

		}

	}

	else{

		if(c[2] > c[0] + 1){

			d = 1;

		}

	}

	if(d == 1){

		cout << "No";

	}

	else{

		cout << "Yes";

	}

	return 0;

}

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



int main(void)

{

	int a1count=0,a2count=0,a4count=0;

	int i,N,x;

	scanf("%d",&N);

	while(N--)

	{

		scanf("%d",&x);

		if(x%4==0)

			a4count++;

		else if(x%2==0)

			a2count++;

		else

			a1count++;

	}

	if(a2count>0 && a1count<=a4count)

		printf("Yes\n");

	else if(a2count==0 && a1count<=a4count+1)

		printf("Yes\n");

	else

		printf("No\n");



	return 0;

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

using namespace std;



int main ()

{

	int n,i,j,k,mod2=0,mod4=0,gg=0;

	int a[100005];

	cin>>n;

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

	{

		cin>>a[i];

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

			mod4++;

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

			mod2++;

		else

			gg++;

	}

	if(mod4>=gg)

		cout<<"Yes"<<endl;

	else //mod4 < gg

	{

		if(mod2 == 0)

		{

			if(mod4+1>=gg)

				cout<<"Yes";

			else

				cout<<"No";

		}

		else//？？？？？？？？？？？？？？？ 

		{

			if( 2 * mod4 + mod2 < n )

				cout<<"No";

			else

				cout<<"Yes";

		}

	}



	return 0;

}

/*分类讨论下。

显然，任意数和 4 的倍数相乘，其结果仍是 4 的倍数；

显然，若存在任意数量 2 的倍数，两两之间乘起来就是 4 的倍数；

如果存在一个数既不是 4 的倍数，也不是 2 的倍数（即因子里没有 2 ）：

放在 2 的倍数旁边，一定不符合要求；

放在 4 的倍数旁边，两两相乘一定是 4 的倍数。

因此符合要求的排列一定是，所有 2 的倍数相邻排在一起，

所有 4 的倍数和剩下的数相间排列，这

些剩下的元素个数不能超过 4 的倍数的数量，不

然所有 4 的倍数都被包起来了。*/




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



int main(void)

{

	int a1count=0,a2count=0,a4count=0;

	int i,N,x;

	scanf("%d",&N);

	while(N--)

	{

		scanf("%d",&x);

		if(x%4==0)

			a4count++;

		else if(x%2==0)

			a2count++;

		else

			a1count++;

	}

	if(a2count>0 && a1count<=a4count)

		printf("Yes\n");

	else if(a2count==0 && a1count<=a4count+1)

		printf("Yes\n");

	else

		printf("No\n");



	return 0;

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

using namespace std;

int main()

{

    int n,i,j,odd=0,even=0,four=0;

    scanf("%d",&n);

    int a[n+10];

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

    {

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

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

        {

            four++;

        }

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

        {

            even++;

        }

        else

        {

            odd++;

        }

    }

   if(odd>four)

   {

       int x=odd-four;

       if(x==1&&(2*four+x)==n)

       {

           printf("Yes");

       }

       else

       {

           printf("No");

       }



   }

   else

   {

       printf("Yes");

   }

   return 0;

}


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

int main(){

    int N;

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

            int count1 = 0,count2 = 0,count4 = 0;

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

            int x;

            scanf("%d",&x);

            if(x%4==0){

                count4++;

            }else if(x%2 == 0&&  x%4!=0){

                count2++;

            }else{

                count1++;

            }

        }

    if(count2>0 && count1<=count4){

        printf("Yes");

    }else if(count2==0 && count1<=count4+1){

        printf("Yes");

    }else{

        printf("No");

    }

    }

    return 0;

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

using namespace std;

int main()

{

	int i,N,count2=0,count4=0,countodd=0;

	cin>>N;

	long long ara[N];

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

		cin>>ara[i];

	}

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

		if(ara[i]%2==0&&ara[i]%4!=0){

			count2++;

		}

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

			count4++;

		}

		if(ara[i]%2!=0){

			countodd++;

		}

	}

	if(count2+count4==N){

		cout<<"Yes";

		return 0;

	}

	if(count4>=countodd&&count2>=2){

		cout<<"Yes";

		return 0;

	}

	else{

		if(count4>=N/2){

			cout<<"Yes";

		}

		else{

			cout<<"No";

		}

	}

	return 0;

}

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

int main(){

    int N;

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

            int count1 = 0,count2 = 0,count4 = 0;

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

            int x;

            scanf("%d",&x);

            if(x%4==0){

                count4++;

            }else if(x%2 == 0&&  x%4!=0){

                count2++;

            }else{

                count1++;

            }

        }

    if(count2>0 && count1<=count4){

        printf("Yes");

    }else if(count2==0 && count1<=count4+1){

        printf("Yes");

    }else{

        printf("No");

    }

    }

    return 0;

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

using namespace std ;

int cnt , cnt4 , cnt2 ;

int main()

{

	int n ;

	cin >> n ;

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

	{

		int x ;

		cin >> x ;

		x = x % 4 ;

		if ( x == 0 ) 

			cnt4 ++  ;

		else if ( x == 2 ) 

			cnt2 ++ ;

	}

	int cnt = n-cnt2-cnt4 ;

	if ( cnt2 ) 

	{

		if ( cnt4 >= cnt ) 

			return cout<<"Yes\n" , 0 ;



	}

	else

	{

		if ( cnt4 && ( cnt4+1 >= cnt )) 

			return cout << "Yes\n" , 0 ;



	}

	cout << "No" << "\n" ;

}

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

int main(){

    int N;

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

            int count1 = 0,count2 = 0,count4 = 0;

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

            int x;

            scanf("%d",&x);

            if(x%4==0){

                count4++;

            }else if(x%2 == 0&&  x%4!=0){

                count2++;

            }else{

                count1++;

            }

        }

    if(count2>0 && count1<=count4){

        printf("Yes");

    }else if(count2==0 && count1<=count4+1){

        printf("Yes");

    }else{

        printf("No");

    }

    }

    return 0;

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

#include <algorithm>

#include <cstring>

#include <stdio.h>

#include <cstring>

#include <string.h>

using namespace std;



int main()

{

		int n;

		cin >> n;

		int four = 0, two = 0;

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

		{

			int x;

			cin >> x;

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

			else if (x % 2 == 0) two++;

		}

		two = max(two - 1, 0);

		if (four * 2 + two >= n - 1)

			cout << "Yes" << endl;

		else cout << "No" << endl;

}

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

int main(){

    int N;

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

            int count1 = 0,count2 = 0,count4 = 0;

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

            int x;

            scanf("%d",&x);

            if(x%4==0){

                count4++;

            }else if(x%2 == 0&&  x%4!=0){

                count2++;

            }else{

                count1++;

            }

        }

    if(count2>0 && count1<=count4){

        printf("Yes");

    }else if(count2==0 && count1<=count4+1){

        printf("Yes");

    }else{

        printf("No");

    }

    }

    return 0;

}
// Slower C++ solution:
//AZ@RK2019

//I know it wll accepted in first go! 

#include <bits/stdc++.h>

#include <iostream>

#include <set>

#include <vector>

#include <map>

#include <queue>

#include <algorithm>

using namespace std;

const int N = 2e5+7;

int n,a,one,two,four;

int main(){

	cin >> n;

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

		cin >> a; 

		if (a%4 == 0){

			four++;

		}

		else if(a%2 == 0){

			two++;

		}

		else{

			one++;

		}

	}

	if(four == one-1){

		if(two){

			cout << "No";

		}

		else{

			cout << "Yes";

		}

	}

	else if(four >= one){

		cout << "Yes";

	}

	else{

		cout << "No";

	}

	

	return 0;

}

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

int main(){

    int N;

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

            int count1 = 0,count2 = 0,count4 = 0;

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

            int x;

            scanf("%d",&x);

            if(x%4==0){

                count4++;

            }else if(x%2 == 0&&  x%4!=0){

                count2++;

            }else{

                count1++;

            }

        }

    if(count2>0 && count1<=count4){

        printf("Yes");

    }else if(count2==0 && count1<=count4+1){

        printf("Yes");

    }else{

        printf("No");

    }

    }

    return 0;

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

using namespace std;

const int N = 1e5 + 20;

typedef long long ll;

ll n, a[N], c[10], d = 0;

int main(){

	cin >> n;

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

		cin >> a[i];

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

			a[i] = 2;

			c[0] += 1;

		}

		else if(a[i] % 4 == 2){

			a[i] = 1;

			c[1] += 1;

		}

		else{

			a[i] = 0;

			c[2] += 1;

		}

	}

	if(c[1] != 0){

		if(c[2] > c[0]){

			d = 1;

		}

	}

	else{

		if(c[2] > c[0] + 1){

			d = 1;

		}

	}

	if(d == 1){

		cout << "No";

	}

	else{

		cout << "Yes";

	}

	return 0;

}

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

int main(){

    int N;

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

            int count1 = 0,count2 = 0,count4 = 0;

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

            int x;

            scanf("%d",&x);

            if(x%4==0){

                count4++;

            }else if(x%2 == 0&&  x%4!=0){

                count2++;

            }else{

                count1++;

            }

        }

    if(count2>0 && count1<=count4){

        printf("Yes");

    }else if(count2==0 && count1<=count4+1){

        printf("Yes");

    }else{

        printf("No");

    }

    }

    return 0;

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

using namespace std;



int main ()

{

	int n,i,j,k,mod2=0,mod4=0,gg=0;

	int a[100005];

	cin>>n;

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

	{

		cin>>a[i];

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

			mod4++;

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

			mod2++;

		else

			gg++;

	}

	if(mod4>=gg)

		cout<<"Yes"<<endl;

	else //mod4 < gg

	{

		if(mod2 == 0)

		{

			if(mod4+1>=gg)

				cout<<"Yes";

			else

				cout<<"No";

		}

		else//？？？？？？？？？？？？？？？ 

		{

			if( 2 * mod4 + mod2 < n )

				cout<<"No";

			else

				cout<<"Yes";

		}

	}



	return 0;

}

/*分类讨论下。

显然，任意数和 4 的倍数相乘，其结果仍是 4 的倍数；

显然，若存在任意数量 2 的倍数，两两之间乘起来就是 4 的倍数；

如果存在一个数既不是 4 的倍数，也不是 2 的倍数（即因子里没有 2 ）：

放在 2 的倍数旁边，一定不符合要求；

放在 4 的倍数旁边，两两相乘一定是 4 的倍数。

因此符合要求的排列一定是，所有 2 的倍数相邻排在一起，

所有 4 的倍数和剩下的数相间排列，这

些剩下的元素个数不能超过 4 的倍数的数量，不

然所有 4 的倍数都被包起来了。*/




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

int main(){

    int N;

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

            int count1 = 0,count2 = 0,count4 = 0;

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

            int x;

            scanf("%d",&x);

            if(x%4==0){

                count4++;

            }else if(x%2 == 0&&  x%4!=0){

                count2++;

            }else{

                count1++;

            }

        }

    if(count2>0 && count1<=count4){

        printf("Yes");

    }else if(count2==0 && count1<=count4+1){

        printf("Yes");

    }else{

        printf("No");

    }

    }

    return 0;

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

#include <cstdio>

#include <algorithm>

#include <math.h>

using namespace std;



int main()

{

    int num, oddCount = 0, times4 = 0, times2 = 0, tmp;

    cin >> num;

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

        cin >> tmp;

        if(tmp & 1) ++oddCount;

        else if(tmp % 4 == 0) ++times4;

        else if(tmp % 2 == 0) ++times2;

    }

    if(times4 >= oddCount) cout << "Yes" << endl;

    else if(times4 + 1 >= oddCount && times2 == 0) cout << "Yes" << endl;

    else cout << "No" << endl;

	return 0;

}


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

int main(){

    int N;

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

            int count1 = 0,count2 = 0,count4 = 0;

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

            int x;

            scanf("%d",&x);

            if(x%4==0){

                count4++;

            }else if(x%2 == 0&&  x%4!=0){

                count2++;

            }else{

                count1++;

            }

        }

    if(count2>0 && count1<=count4){

        printf("Yes");

    }else if(count2==0 && count1<=count4+1){

        printf("Yes");

    }else{

        printf("No");

    }

    }

    return 0;

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

using namespace std;

int main()

{

    int n,i,j,odd=0,even=0,four=0;

    scanf("%d",&n);

    int a[n+10];

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

    {

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

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

        {

            four++;

        }

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

        {

            even++;

        }

        else

        {

            odd++;

        }

    }

   if(odd>four)

   {

       int x=odd-four;

       if(x==1&&(2*four+x)==n)

       {

           printf("Yes");

       }

       else

       {

           printf("No");

       }



   }

   else

   {

       printf("Yes");

   }

   return 0;

}


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



int main(void)

{

	int a1count=0,a2count=0,a4count=0;

	int i,N,x;

	scanf("%d",&N);

	while(N--)

	{

		scanf("%d",&x);

		if(x%4==0)

			a4count++;

		else if(x%2==0)

			a2count++;

		else

			a1count++;

	}//得出3类数字的个数 

	if(a2count>0 && a1count<=a4count)

		printf("Yes\n");//典型的幸运数列的排列方法 

	else if(a2count==0 && a1count<=a4count+1)//同样也是 

		printf("Yes\n");

	else

		printf("No\n");



	return 0;

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

using namespace std;

int main()

{

	int i,N,count2=0,count4=0,countodd=0;

	cin>>N;

	long long ara[N];

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

		cin>>ara[i];

	}

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

		if(ara[i]%2==0&&ara[i]%4!=0){

			count2++;

		}

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

			count4++;

		}

		if(ara[i]%2!=0){

			countodd++;

		}

	}

	if(count2+count4==N){

		cout<<"Yes";

		return 0;

	}

	if(count4>=countodd&&count2>=2){

		cout<<"Yes";

		return 0;

	}

	else{

		if(count4>=N/2){

			cout<<"Yes";

		}

		else{

			cout<<"No";

		}

	}

	return 0;

}

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



int main(void)

{

	int a1count=0,a2count=0,a4count=0;

	int i,N,x;

	scanf("%d",&N);

	while(N--)

	{

		scanf("%d",&x);

		if(x%4==0)

			a4count++;

		else if(x%2==0)

			a2count++;

		else

			a1count++;

	}//得出3类数字的个数 

	if(a2count>0 && a1count<=a4count)

		printf("Yes\n");//典型的幸运数列的排列方法 

	else if(a2count==0 && a1count<=a4count+1)//同样也是 

		printf("Yes\n");

	else

		printf("No\n");



	return 0;

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

using namespace std ;

int cnt , cnt4 , cnt2 ;

int main()

{

	int n ;

	cin >> n ;

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

	{

		int x ;

		cin >> x ;

		x = x % 4 ;

		if ( x == 0 ) 

			cnt4 ++  ;

		else if ( x == 2 ) 

			cnt2 ++ ;

	}

	int cnt = n-cnt2-cnt4 ;

	if ( cnt2 ) 

	{

		if ( cnt4 >= cnt ) 

			return cout<<"Yes\n" , 0 ;



	}

	else

	{

		if ( cnt4 && ( cnt4+1 >= cnt )) 

			return cout << "Yes\n" , 0 ;



	}

	cout << "No" << "\n" ;

}

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



int main(void)

{

	int a1count=0,a2count=0,a4count=0;

	int i,N,x;

	scanf("%d",&N);

	while(N--)

	{

		scanf("%d",&x);

		if(x%4==0)

			a4count++;

		else if(x%2==0)

			a2count++;

		else

			a1count++;

	}//得出3类数字的个数 

	if(a2count>0 && a1count<=a4count)

		printf("Yes\n");//典型的幸运数列的排列方法 

	else if(a2count==0 && a1count<=a4count+1)//同样也是 

		printf("Yes\n");

	else

		printf("No\n");



	return 0;

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

#include <algorithm>

#include <cstring>

#include <stdio.h>

#include <cstring>

#include <string.h>

using namespace std;



int main()

{

		int n;

		cin >> n;

		int four = 0, two = 0;

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

		{

			int x;

			cin >> x;

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

			else if (x % 2 == 0) two++;

		}

		two = max(two - 1, 0);

		if (four * 2 + two >= n - 1)

			cout << "Yes" << endl;

		else cout << "No" << endl;

}

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



int main(void)

{

	int a1count=0,a2count=0,a4count=0;

	int i,N,x;

	scanf("%d",&N);

	while(N--)

	{

		scanf("%d",&x);

		if(x%4==0)

			a4count++;

		else if(x%2==0)

			a2count++;

		else

			a1count++;

	}//得出3类数字的个数 

	if(a2count>0 && a1count<=a4count)

		printf("Yes\n");//典型的幸运数列的排列方法 

	else if(a2count==0 && a1count<=a4count+1)//同样也是 

		printf("Yes\n");

	else

		printf("No\n");



	return 0;

}
// Slower C++ solution:
//AZ@RK2019

//I know it wll accepted in first go! 

#include <bits/stdc++.h>

#include <iostream>

#include <set>

#include <vector>

#include <map>

#include <queue>

#include <algorithm>

using namespace std;

const int N = 2e5+7;

int n,a,one,two,four;

int main(){

	cin >> n;

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

		cin >> a; 

		if (a%4 == 0){

			four++;

		}

		else if(a%2 == 0){

			two++;

		}

		else{

			one++;

		}

	}

	if(four == one-1){

		if(two){

			cout << "No";

		}

		else{

			cout << "Yes";

		}

	}

	else if(four >= one){

		cout << "Yes";

	}

	else{

		cout << "No";

	}

	

	return 0;

}

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



int main(void)

{

	int a1count=0,a2count=0,a4count=0;

	int i,N,x;

	scanf("%d",&N);

	while(N--)

	{

		scanf("%d",&x);

		if(x%4==0)

			a4count++;

		else if(x%2==0)

			a2count++;

		else

			a1count++;

	}//得出3类数字的个数 

	if(a2count>0 && a1count<=a4count)

		printf("Yes\n");//典型的幸运数列的排列方法 

	else if(a2count==0 && a1count<=a4count+1)//同样也是 

		printf("Yes\n");

	else

		printf("No\n");



	return 0;

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

using namespace std;

const int N = 1e5 + 20;

typedef long long ll;

ll n, a[N], c[10], d = 0;

int main(){

	cin >> n;

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

		cin >> a[i];

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

			a[i] = 2;

			c[0] += 1;

		}

		else if(a[i] % 4 == 2){

			a[i] = 1;

			c[1] += 1;

		}

		else{

			a[i] = 0;

			c[2] += 1;

		}

	}

	if(c[1] != 0){

		if(c[2] > c[0]){

			d = 1;

		}

	}

	else{

		if(c[2] > c[0] + 1){

			d = 1;

		}

	}

	if(d == 1){

		cout << "No";

	}

	else{

		cout << "Yes";

	}

	return 0;

}

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



int main(void)

{

	int a1count=0,a2count=0,a4count=0;

	int i,N,x;

	scanf("%d",&N);

	while(N--)

	{

		scanf("%d",&x);

		if(x%4==0)

			a4count++;

		else if(x%2==0)

			a2count++;

		else

			a1count++;

	}//得出3类数字的个数 

	if(a2count>0 && a1count<=a4count)

		printf("Yes\n");//典型的幸运数列的排列方法 

	else if(a2count==0 && a1count<=a4count+1)//同样也是 

		printf("Yes\n");

	else

		printf("No\n");



	return 0;

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

using namespace std;



int main ()

{

	int n,i,j,k,mod2=0,mod4=0,gg=0;

	int a[100005];

	cin>>n;

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

	{

		cin>>a[i];

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

			mod4++;

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

			mod2++;

		else

			gg++;

	}

	if(mod4>=gg)

		cout<<"Yes"<<endl;

	else //mod4 < gg

	{

		if(mod2 == 0)

		{

			if(mod4+1>=gg)

				cout<<"Yes";

			else

				cout<<"No";

		}

		else//？？？？？？？？？？？？？？？ 

		{

			if( 2 * mod4 + mod2 < n )

				cout<<"No";

			else

				cout<<"Yes";

		}

	}



	return 0;

}

/*分类讨论下。

显然，任意数和 4 的倍数相乘，其结果仍是 4 的倍数；

显然，若存在任意数量 2 的倍数，两两之间乘起来就是 4 的倍数；

如果存在一个数既不是 4 的倍数，也不是 2 的倍数（即因子里没有 2 ）：

放在 2 的倍数旁边，一定不符合要求；

放在 4 的倍数旁边，两两相乘一定是 4 的倍数。

因此符合要求的排列一定是，所有 2 的倍数相邻排在一起，

所有 4 的倍数和剩下的数相间排列，这

些剩下的元素个数不能超过 4 的倍数的数量，不

然所有 4 的倍数都被包起来了。*/




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



int main(void)

{

	int a1count=0,a2count=0,a4count=0;

	int i,N,x;

	scanf("%d",&N);

	while(N--)

	{

		scanf("%d",&x);

		if(x%4==0)

			a4count++;

		else if(x%2==0)

			a2count++;

		else

			a1count++;

	}//得出3类数字的个数 

	if(a2count>0 && a1count<=a4count)

		printf("Yes\n");//典型的幸运数列的排列方法 

	else if(a2count==0 && a1count<=a4count+1)//同样也是 

		printf("Yes\n");

	else

		printf("No\n");



	return 0;

}