stablegradients/pie-gem5-pairs huggingface dataset:
// 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.3028209164880575x):
#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>

int main(){

int a=0,b=0,i,j,k,n;

scanf("%d",&n);

for(i=1;i<=n;i++){scanf("%d",&k);

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

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

}

if((a*2+1>=n)||(a*2+b>=n))printf("Yes");

else printf("No");

return 0;

}




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



int main() {

	//N4记录4的倍数；N2记录2的倍数且不等于4；N1记录其他

	int N=0, N1 = 0, N2 = 0, N4 = 0;

	int tmp;

	scanf("%d", &N);



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

		scanf("%d", &tmp);

		if (tmp % 4 == 0)

			N4++;

		else if (tmp % 2 == 0) //是2但不是4的倍数

			N2++;

		

	}

	N1 = N - N2 - N4;

	if ((N2 == 0 && N4 >= N1 - 1) || (N2 > 0 && N4 >= N1))

		printf("Yes\n");

	else

		printf("No\n");

	return 0;

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

using namespace std;

int main(){

	int a,b,x=0,y=0,cnt,i;

	cin>>a;

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

		cin>>b;

		cnt=0;

		if(b%4==0)cnt++;

		if(b%2==0)cnt++;

		if(cnt==1)x++;

		if(cnt==2)y++;

	}

	if(y>=a-x-y)cout<<"Yes";

	else if(!x&&y==a/2)cout<<"Yes";

	else cout<<"No";

}

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



int main() {

	//N4记录4的倍数；N2记录2的倍数且不等于4；N1记录其他

	int N=0, N1 = 0, N2 = 0, N4 = 0;

	int tmp;

	scanf("%d", &N);



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

		scanf("%d", &tmp);

		if (tmp % 4 == 0)

			N4++;

		else if (tmp % 2 == 0) //是2但不是4的倍数

			N2++;

		

	}

	N1 = N - N2 - N4;

	if ((N2 == 0 && N4 >= N1 - 1) || (N2 > 0 && N4 >= N1))

		printf("Yes\n");

	else

		printf("No\n");

	return 0;

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

#include<algorithm>

using namespace std;

int main()

{

    int a=0,b=0,c=0;//a 4 ;b 2;c others

    int n;

    cin>>n;

    while(n--){

    	int tmp;

    	cin>>tmp;

    	if(tmp%4==0)

    		a++;

		else if(tmp%2==0)

			b++;

		else

			c++;

	}

	if(c==0&&a==0){

		if(b==1)

			cout<<"No"<<endl;

		else	

			cout<<"Yes"<<endl;

		return 0;

	}

	if(b!=0)

		c++;

	if(a==0&&c!=0)

		cout<<"No"<<endl;

	else if(c<=a+1)

		cout<<"Yes"<<endl;

	else

		cout<<"No"<<endl;

    return 0;

}

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



int main() {

	//N4记录4的倍数；N2记录2的倍数且不等于4；N1记录其他

	int N=0, N1 = 0, N2 = 0, N4 = 0;

	int tmp;

	scanf("%d", &N);



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

		scanf("%d", &tmp);

		if (tmp % 4 == 0)

			N4++;

		else if (tmp % 2 == 0) //是2但不是4的倍数

			N2++;

		

	}

	N1 = N - N2 - N4;

	if ((N2 == 0 && N4 >= N1 - 1) || (N2 > 0 && N4 >= N1))

		printf("Yes\n");

	else

		printf("No\n");

	return 0;

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



using namespace std;



#define fir first

#define sec second

#define ins insert

#define pb push_back

#define po pop_back

#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)

#define PI 3.14159265

#define YES cout << "Yes" << '\n';

#define NO cout << "No" << '\n';



typedef long long ll;



const ll max_n = 1e6 + 10 , Mod = 1e9 + 7 , inf = 1e18;

ll n , four , m_two , tmp , num;



void read_input(){

        cin >> n;

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

                cin >> num;

                

                if(num % 4 == 2)

                        m_two++;

                

                else if(num % 4 == 0)

                        four++;

        }

}



void solve(){

        tmp = n - m_two - four;



        if(m_two){

                if(four >= tmp)

                        YES

                else

                        NO

        }



        else{

                if(four != 0 && ((four + 1) >= tmp))

                        YES

                else

                        NO

        }

}



void output(){

        //no output

}



int main(){

        IOS;

        read_input();

        solve();

        output();

        return 0;

}

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



int main() {

	//N4记录4的倍数；N2记录2的倍数且不等于4；N1记录其他

	int N=0, N1 = 0, N2 = 0, N4 = 0;

	int tmp;

	scanf("%d", &N);



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

		scanf("%d", &tmp);

		if (tmp % 4 == 0)

			N4++;

		else if (tmp % 2 == 0) //是2但不是4的倍数

			N2++;

		

	}

	N1 = N - N2 - N4;

	if ((N2 == 0 && N4 >= N1 - 1) || (N2 > 0 && N4 >= N1))

		printf("Yes\n");

	else

		printf("No\n");

	return 0;

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

using namespace std;



#define vi push_back

#define vo pop_back

#define mp make_pair

#define fe first

#define se second

typedef long long ll;



int n;

vector <int> a, Foura;



void Solve () {

	int tmp, FourCount = 0, TwoCount = 0;

	cin >> n;

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

		cin >> tmp;

		if (tmp % 4 == 0) {

			FourCount++;

		}

		else if (tmp % 2 == 0) {

			TwoCount++;

		}

	}

	if (FourCount + (TwoCount / 2) < (n / 2)) {

		cout << "No\n";

		exit (0);

	}

	else {

		cout << "Yes\n";

		exit(0);

	}

}



int main () {

	Solve();

	return 0;

}




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



int main() {

	//N4记录4的倍数；N2记录2的倍数且不等于4；N1记录其他

	int N=0, N1 = 0, N2 = 0, N4 = 0;

	int tmp;

	scanf("%d", &N);



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

		scanf("%d", &tmp);

		if (tmp % 4 == 0)

			N4++;

		else if (tmp % 2 == 0) //是2但不是4的倍数

			N2++;

		

	}

	N1 = N - N2 - N4;

	if ((N2 == 0 && N4 >= N1 - 1) || (N2 > 0 && N4 >= N1))

		printf("Yes\n");

	else

		printf("No\n");

	return 0;

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

int main(){

int a=0,b=0,i,j,k,n;

scanf("%d",&n);

for(i=1;i<=n;i++){scanf("%d",&k);

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

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

}

if((a*2+1>=n)||(a*2+b>=n))printf("Yes");

else printf("No");

return 0;

}




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

int main(){

	int counta=0,countb=0,countc=0;

	int N;int num[100000];

	scanf("%d",&N);

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

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

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

			counta++;

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

			countb++;

		else

			countc++;

	}

	if(counta==countc-1&&counta+countc==N)

		printf("Yes\n");

	else if(counta>=countc)

		printf("Yes\n");

	else

		printf("No\n");

	return 0;

	

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

using namespace std;

int main(){

	int a,b,x=0,y=0,cnt,i;

	cin>>a;

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

		cin>>b;

		cnt=0;

		if(b%4==0)cnt++;

		if(b%2==0)cnt++;

		if(cnt==1)x++;

		if(cnt==2)y++;

	}

	if(y>=a-x-y)cout<<"Yes";

	else if(!x&&y==a/2)cout<<"Yes";

	else cout<<"No";

}

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

int main(){

	int counta=0,countb=0,countc=0;

	int N;int num[100000];

	scanf("%d",&N);

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

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

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

			counta++;

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

			countb++;

		else

			countc++;

	}

	if(counta==countc-1&&counta+countc==N)

		printf("Yes\n");

	else if(counta>=countc)

		printf("Yes\n");

	else

		printf("No\n");

	return 0;

	

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

#include<algorithm>

using namespace std;

int main()

{

    int a=0,b=0,c=0;//a 4 ;b 2;c others

    int n;

    cin>>n;

    while(n--){

    	int tmp;

    	cin>>tmp;

    	if(tmp%4==0)

    		a++;

		else if(tmp%2==0)

			b++;

		else

			c++;

	}

	if(c==0&&a==0){

		if(b==1)

			cout<<"No"<<endl;

		else	

			cout<<"Yes"<<endl;

		return 0;

	}

	if(b!=0)

		c++;

	if(a==0&&c!=0)

		cout<<"No"<<endl;

	else if(c<=a+1)

		cout<<"Yes"<<endl;

	else

		cout<<"No"<<endl;

    return 0;

}

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

int main(){

	int counta=0,countb=0,countc=0;

	int N;int num[100000];

	scanf("%d",&N);

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

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

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

			counta++;

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

			countb++;

		else

			countc++;

	}

	if(counta==countc-1&&counta+countc==N)

		printf("Yes\n");

	else if(counta>=countc)

		printf("Yes\n");

	else

		printf("No\n");

	return 0;

	

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



using namespace std;



#define fir first

#define sec second

#define ins insert

#define pb push_back

#define po pop_back

#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)

#define PI 3.14159265

#define YES cout << "Yes" << '\n';

#define NO cout << "No" << '\n';



typedef long long ll;



const ll max_n = 1e6 + 10 , Mod = 1e9 + 7 , inf = 1e18;

ll n , four , m_two , tmp , num;



void read_input(){

        cin >> n;

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

                cin >> num;

                

                if(num % 4 == 2)

                        m_two++;

                

                else if(num % 4 == 0)

                        four++;

        }

}



void solve(){

        tmp = n - m_two - four;



        if(m_two){

                if(four >= tmp)

                        YES

                else

                        NO

        }



        else{

                if(four != 0 && ((four + 1) >= tmp))

                        YES

                else

                        NO

        }

}



void output(){

        //no output

}



int main(){

        IOS;

        read_input();

        solve();

        output();

        return 0;

}

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

int main(){

	int counta=0,countb=0,countc=0;

	int N;int num[100000];

	scanf("%d",&N);

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

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

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

			counta++;

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

			countb++;

		else

			countc++;

	}

	if(counta==countc-1&&counta+countc==N)

		printf("Yes\n");

	else if(counta>=countc)

		printf("Yes\n");

	else

		printf("No\n");

	return 0;

	

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

using namespace std;



#define vi push_back

#define vo pop_back

#define mp make_pair

#define fe first

#define se second

typedef long long ll;



int n;

vector <int> a, Foura;



void Solve () {

	int tmp, FourCount = 0, TwoCount = 0;

	cin >> n;

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

		cin >> tmp;

		if (tmp % 4 == 0) {

			FourCount++;

		}

		else if (tmp % 2 == 0) {

			TwoCount++;

		}

	}

	if (FourCount + (TwoCount / 2) < (n / 2)) {

		cout << "No\n";

		exit (0);

	}

	else {

		cout << "Yes\n";

		exit(0);

	}

}



int main () {

	Solve();

	return 0;

}




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

int main(){

	int counta=0,countb=0,countc=0;

	int N;int num[100000];

	scanf("%d",&N);

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

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

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

			counta++;

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

			countb++;

		else

			countc++;

	}

	if(counta==countc-1&&counta+countc==N)

		printf("Yes\n");

	else if(counta>=countc)

		printf("Yes\n");

	else

		printf("No\n");

	return 0;

	

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

int main(){

int a=0,b=0,i,j,k,n;

scanf("%d",&n);

for(i=1;i<=n;i++){scanf("%d",&k);

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

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

}

if((a*2+1>=n)||(a*2+b>=n))printf("Yes");

else printf("No");

return 0;

}




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

#include<algorithm>

using namespace std;

int main()

{

    int n,a;

    scanf("%d",&n);

    int numodd=0,num2=0,num4=0;   //奇数， 2倍数 ，  4倍数

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

    {

        scanf("%d",&a);

        if(a%2==0)

        {

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

            else        num2++;

        }

        else

            numodd++;



    }

    if(num2)    num2=1;  //多个2倍数重新排列相当于一个2倍数

    if(num2+numodd-1<=num4)

        printf("Yes");

    else if(numodd==0)

        printf("Yes");

    else

        printf("No");

    return 0;

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

using namespace std;

int main(){

	int a,b,x=0,y=0,cnt,i;

	cin>>a;

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

		cin>>b;

		cnt=0;

		if(b%4==0)cnt++;

		if(b%2==0)cnt++;

		if(cnt==1)x++;

		if(cnt==2)y++;

	}

	if(y>=a-x-y)cout<<"Yes";

	else if(!x&&y==a/2)cout<<"Yes";

	else cout<<"No";

}

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

#include<algorithm>

using namespace std;

int main()

{

    int n,a;

    scanf("%d",&n);

    int numodd=0,num2=0,num4=0;   //奇数， 2倍数 ，  4倍数

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

    {

        scanf("%d",&a);

        if(a%2==0)

        {

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

            else        num2++;

        }

        else

            numodd++;



    }

    if(num2)    num2=1;  //多个2倍数重新排列相当于一个2倍数

    if(num2+numodd-1<=num4)

        printf("Yes");

    else if(numodd==0)

        printf("Yes");

    else

        printf("No");

    return 0;

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

#include<algorithm>

using namespace std;

int main()

{

    int a=0,b=0,c=0;//a 4 ;b 2;c others

    int n;

    cin>>n;

    while(n--){

    	int tmp;

    	cin>>tmp;

    	if(tmp%4==0)

    		a++;

		else if(tmp%2==0)

			b++;

		else

			c++;

	}

	if(c==0&&a==0){

		if(b==1)

			cout<<"No"<<endl;

		else	

			cout<<"Yes"<<endl;

		return 0;

	}

	if(b!=0)

		c++;

	if(a==0&&c!=0)

		cout<<"No"<<endl;

	else if(c<=a+1)

		cout<<"Yes"<<endl;

	else

		cout<<"No"<<endl;

    return 0;

}

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

#include<algorithm>

using namespace std;

int main()

{

    int n,a;

    scanf("%d",&n);

    int numodd=0,num2=0,num4=0;   //奇数， 2倍数 ，  4倍数

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

    {

        scanf("%d",&a);

        if(a%2==0)

        {

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

            else        num2++;

        }

        else

            numodd++;



    }

    if(num2)    num2=1;  //多个2倍数重新排列相当于一个2倍数

    if(num2+numodd-1<=num4)

        printf("Yes");

    else if(numodd==0)

        printf("Yes");

    else

        printf("No");

    return 0;

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



using namespace std;



#define fir first

#define sec second

#define ins insert

#define pb push_back

#define po pop_back

#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)

#define PI 3.14159265

#define YES cout << "Yes" << '\n';

#define NO cout << "No" << '\n';



typedef long long ll;



const ll max_n = 1e6 + 10 , Mod = 1e9 + 7 , inf = 1e18;

ll n , four , m_two , tmp , num;



void read_input(){

        cin >> n;

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

                cin >> num;

                

                if(num % 4 == 2)

                        m_two++;

                

                else if(num % 4 == 0)

                        four++;

        }

}



void solve(){

        tmp = n - m_two - four;



        if(m_two){

                if(four >= tmp)

                        YES

                else

                        NO

        }



        else{

                if(four != 0 && ((four + 1) >= tmp))

                        YES

                else

                        NO

        }

}



void output(){

        //no output

}



int main(){

        IOS;

        read_input();

        solve();

        output();

        return 0;

}

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

#include<algorithm>

using namespace std;

int main()

{

    int n,a;

    scanf("%d",&n);

    int numodd=0,num2=0,num4=0;   //奇数， 2倍数 ，  4倍数

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

    {

        scanf("%d",&a);

        if(a%2==0)

        {

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

            else        num2++;

        }

        else

            numodd++;



    }

    if(num2)    num2=1;  //多个2倍数重新排列相当于一个2倍数

    if(num2+numodd-1<=num4)

        printf("Yes");

    else if(numodd==0)

        printf("Yes");

    else

        printf("No");

    return 0;

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

using namespace std;



#define vi push_back

#define vo pop_back

#define mp make_pair

#define fe first

#define se second

typedef long long ll;



int n;

vector <int> a, Foura;



void Solve () {

	int tmp, FourCount = 0, TwoCount = 0;

	cin >> n;

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

		cin >> tmp;

		if (tmp % 4 == 0) {

			FourCount++;

		}

		else if (tmp % 2 == 0) {

			TwoCount++;

		}

	}

	if (FourCount + (TwoCount / 2) < (n / 2)) {

		cout << "No\n";

		exit (0);

	}

	else {

		cout << "Yes\n";

		exit(0);

	}

}



int main () {

	Solve();

	return 0;

}




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

#include<algorithm>

using namespace std;

int main()

{

    int n,a;

    scanf("%d",&n);

    int numodd=0,num2=0,num4=0;   //奇数， 2倍数 ，  4倍数

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

    {

        scanf("%d",&a);

        if(a%2==0)

        {

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

            else        num2++;

        }

        else

            numodd++;



    }

    if(num2)    num2=1;  //多个2倍数重新排列相当于一个2倍数

    if(num2+numodd-1<=num4)

        printf("Yes");

    else if(numodd==0)

        printf("Yes");

    else

        printf("No");

    return 0;

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

using namespace std;

int main()

{

	int n,a1=0,a2=0,a4=0;

	cin>>n;

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

		int t;

		cin>>t;

		if(t%4==0)

			a4++;

		else if(t%2==0)

			a2++;

		else a1++;

	}

	if(a1<=a4&&a2>0)

		cout<<"Yes"<<endl;

	else if(a2==0&&a1<=a4+1)

	cout<<"Yes"<<endl;

		else cout<<"No"<<endl;

	return 0;

}

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

#include<algorithm>

using namespace std;

int main()

{

    int n,a;

    scanf("%d",&n);

    int numodd=0,num2=0,num4=0;   //奇数， 2倍数 ，  4倍数

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

    {

        scanf("%d",&a);

        if(a%2==0)

        {

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

            else        num2++;

        }

        else

            numodd++;



    }

    if(num2)    num2=1;  //多个2倍数重新排列相当于一个2倍数

    if(num2+numodd-1<=num4)

        printf("Yes");

    else if(numodd==0)

        printf("Yes");

    else

        printf("No");

    return 0;

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

int main(){

int a=0,b=0,i,j,k,n;

scanf("%d",&n);

for(i=1;i<=n;i++){scanf("%d",&k);

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

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

}

if((a*2+1>=n)||(a*2+b>=n))printf("Yes");

else printf("No");

return 0;

}




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

#include <stdlib.h>

int main(int argc, char *argv[]) {

	int n;scanf("%d",&n);

	int nn=n;

	int x;

	int n4=0,n2=0,n1=0;

	while(nn--)

	{

		scanf("%d",&x);

		if(x%4==0)

			n4++;

		else if(x%2==0)

			n2++;

		else

			n1++;

	} 

	if(n2)

	{

		if(n4>=n1)

			printf("Yes\n");

		else

			printf("No\n");

	}

	else

	{

		if(n4+1>=n1)

			printf("Yes\n");

		else

			printf("No\n");

	}

	return 0;

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

using namespace std;

int main(){

	int a,b,x=0,y=0,cnt,i;

	cin>>a;

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

		cin>>b;

		cnt=0;

		if(b%4==0)cnt++;

		if(b%2==0)cnt++;

		if(cnt==1)x++;

		if(cnt==2)y++;

	}

	if(y>=a-x-y)cout<<"Yes";

	else if(!x&&y==a/2)cout<<"Yes";

	else cout<<"No";

}

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

#include <stdlib.h>

int main(int argc, char *argv[]) {

	int n;scanf("%d",&n);

	int nn=n;

	int x;

	int n4=0,n2=0,n1=0;

	while(nn--)

	{

		scanf("%d",&x);

		if(x%4==0)

			n4++;

		else if(x%2==0)

			n2++;

		else

			n1++;

	} 

	if(n2)

	{

		if(n4>=n1)

			printf("Yes\n");

		else

			printf("No\n");

	}

	else

	{

		if(n4+1>=n1)

			printf("Yes\n");

		else

			printf("No\n");

	}

	return 0;

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

#include<algorithm>

using namespace std;

int main()

{

    int a=0,b=0,c=0;//a 4 ;b 2;c others

    int n;

    cin>>n;

    while(n--){

    	int tmp;

    	cin>>tmp;

    	if(tmp%4==0)

    		a++;

		else if(tmp%2==0)

			b++;

		else

			c++;

	}

	if(c==0&&a==0){

		if(b==1)

			cout<<"No"<<endl;

		else	

			cout<<"Yes"<<endl;

		return 0;

	}

	if(b!=0)

		c++;

	if(a==0&&c!=0)

		cout<<"No"<<endl;

	else if(c<=a+1)

		cout<<"Yes"<<endl;

	else

		cout<<"No"<<endl;

    return 0;

}

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

#include <stdlib.h>

int main(int argc, char *argv[]) {

	int n;scanf("%d",&n);

	int nn=n;

	int x;

	int n4=0,n2=0,n1=0;

	while(nn--)

	{

		scanf("%d",&x);

		if(x%4==0)

			n4++;

		else if(x%2==0)

			n2++;

		else

			n1++;

	} 

	if(n2)

	{

		if(n4>=n1)

			printf("Yes\n");

		else

			printf("No\n");

	}

	else

	{

		if(n4+1>=n1)

			printf("Yes\n");

		else

			printf("No\n");

	}

	return 0;

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



using namespace std;



#define fir first

#define sec second

#define ins insert

#define pb push_back

#define po pop_back

#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)

#define PI 3.14159265

#define YES cout << "Yes" << '\n';

#define NO cout << "No" << '\n';



typedef long long ll;



const ll max_n = 1e6 + 10 , Mod = 1e9 + 7 , inf = 1e18;

ll n , four , m_two , tmp , num;



void read_input(){

        cin >> n;

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

                cin >> num;

                

                if(num % 4 == 2)

                        m_two++;

                

                else if(num % 4 == 0)

                        four++;

        }

}



void solve(){

        tmp = n - m_two - four;



        if(m_two){

                if(four >= tmp)

                        YES

                else

                        NO

        }



        else{

                if(four != 0 && ((four + 1) >= tmp))

                        YES

                else

                        NO

        }

}



void output(){

        //no output

}



int main(){

        IOS;

        read_input();

        solve();

        output();

        return 0;

}

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

#include <stdlib.h>

int main(int argc, char *argv[]) {

	int n;scanf("%d",&n);

	int nn=n;

	int x;

	int n4=0,n2=0,n1=0;

	while(nn--)

	{

		scanf("%d",&x);

		if(x%4==0)

			n4++;

		else if(x%2==0)

			n2++;

		else

			n1++;

	} 

	if(n2)

	{

		if(n4>=n1)

			printf("Yes\n");

		else

			printf("No\n");

	}

	else

	{

		if(n4+1>=n1)

			printf("Yes\n");

		else

			printf("No\n");

	}

	return 0;

}