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

using namespace std;

#define ll long long

ll arr[200009];

int main()

{

    ll n,t,m,x,i,j,k,maxi = INT_MIN,mini = INT_MAX,flag =0,sum=0,sum1=0;

    vector<ll>vi;

    cin>>n;

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

    {

        cin>>x;

        if(x% 4==0)

            sum++;

        else if(x%4 == 2)

            sum1++;

    }

    n--;

    if(sum1>0){

            sum1--;

    n-=sum1;

    }

    n-=sum*2;

   // cout<<n<<endl;

    if(n<=0)

        cout<<"Yes"<<endl;

    else

        cout<<"No"<<endl;

    return 0;

}


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

#include<string.h>

#include<stdio.h>

#include<stdlib.h>

#include<string.h>

#include<algorithm>

#include<string>

#include<queue>

#include<vector>

#include<stack>

#include<set>

#include<map>

using namespace std;



int ser[1000010];

int main()

{

	int c1, c2, c4;

	int n,temp;

	c1 = c2 = c4 = 0;

	scanf("%d", &n);

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

	{

		scanf("%d", &temp);

		if (temp % 4 == 0)

			c4++;

		else if (temp % 2 == 0)

			c2++;

		else

			c1++;

	}

	if (c2 != 0)

	{

		if (c1 <= c4)

			printf("Yes\n");

		else

			printf("No\n");

	}

	else

	{

		if(c1<=c4+1)

			printf("Yes\n");

		else

			printf("No\n");

	}

 	return 0;

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

#include<ctype.h>

#include<cmath>

#include<queue>

#define MAXN 10001



using namespace std;

typedef long long ll;



int main()

{

    int n;

    scanf("%d",&n);

    int a[n];

    int ct_2=0,ct_4=0;

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

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

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

            ct_4++;

        else{

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

                ct_2++;

        }

    }

    if(ct_2>=2)

        n-=ct_2-1;

    if(n<=(3+(ct_4-1)*2)&&ct_4>=1||n==1)

        printf("Yes\n");

    else printf("No\n");

    return 0;

}


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

#include<string.h>

#include<stdio.h>

#include<stdlib.h>

#include<string.h>

#include<algorithm>

#include<string>

#include<queue>

#include<vector>

#include<stack>

#include<set>

#include<map>

using namespace std;



int ser[1000010];

int main()

{

	int c1, c2, c4;

	int n,temp;

	c1 = c2 = c4 = 0;

	scanf("%d", &n);

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

	{

		scanf("%d", &temp);

		if (temp % 4 == 0)

			c4++;

		else if (temp % 2 == 0)

			c2++;

		else

			c1++;

	}

	if (c2 != 0)

	{

		if (c1 <= c4)

			printf("Yes\n");

		else

			printf("No\n");

	}

	else

	{

		if(c1<=c4+1)

			printf("Yes\n");

		else

			printf("No\n");

	}

 	return 0;

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

using namespace std;

int main()

{

    int n,i,j=0,s=0,m=0;

    cin>>n;

    int a[n];

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

    {   cin>>a[i];

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

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

        else m++;

    }

    if(j>=m||(j-m==-1)&&s==0) cout<<"Yes"<<endl;

    else cout<<"No"<<endl;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.302289784536788x):




#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>

#define LL long long

using namespace std;



#define maxn 10007

const int INF=0x3f3f3f3f;





int main()

{

    int a,b,c;

    a=b=c=0;

    int n,i,j,k,x,y;

    scanf("%d",&n);

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

    {

        scanf("%d",&x);

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

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

        else a++;

    }

    if(c>=a)

    {

        printf("Yes\n");

        return 0;

    }

    if(c==a-1&&b==0)

    {

        printf("Yes\n");

        return 0;

    }

    printf("No\n");



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.229313314360493x):




#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 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.289878819405347x):




#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 <stdio.h>

#include <stdlib.h>

#include <iostream>

#include <algorithm>

#include <cmath>

#include <cstring>

#include <map>

#include <vector>



using namespace std;



int A[110000];

int cnt1=0;

int cnt2=0;



int main()

{

    int n;

    scanf("%d",&n);

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

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

    

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

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

            cnt1++;

        }

        if(A[i]%2==1)

            cnt2++;

    }

    if(cnt1>=n/2 || cnt1>=cnt2){

        printf("Yes\n");

    }else{

        printf("No\n");

    }



    return 0;

}




// Faster C++ solution for the same problem (measured speedup: 5.231897572442927x):




#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;



#define pb push_back

#define ff first

#define ss second



typedef long long ll;

const ll MAXN = 2e6 + 10, inf = 1e18, mod = 1e9 + 7;



struct pair_hash {

	template <class T1, class T2>

	std::size_t operator () (const std::pair<T1,T2> &p) const {

		auto h1 = std::hash<T1>{}(p.first);

		auto h2 = std::hash<T2>{}(p.second);



		return h1 ^ h2;  

	}

};



ll pw(ll te, ll tee) {

	if (tee == 0)	return 1;

	ll res = pw(te, tee / 2);

	return (tee % 2 ? te * res * res : res * res);

}



ll n, a[MAXN], t, k, p;



void Read_input() {

	cin >> n;

	for (ll i = 1; i <= n; i++)	cin >> a[i];

}



void Solve() {

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

		if (a[i] % 2)	t++;

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

		else	p++;

	}

	if (k >= t or (p == 0 and k >= t - 1))	cout << "Yes";

	else	cout << "No";

}





int main() {



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

	//freopen("input.txt", "r", stdin),	freopen("output.txt", "w", stdout);



	Read_input(),	Solve();

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.35724088708282x):




#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:
//KING NIKAN

#include <bits/stdc++.h>

using namespace std;

typedef long long ll ;

int a[100010] ;

int main() 

{

	ios::sync_with_stdio(false) ;

	cin.tie(0) ;

	cout.tie(0) ;

	int n ;

	cin >> n ;

	int cnt_4=0 ,cnt_2=0 ,cnt_1=0 ;

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

	{

		cin >> a[i] ;

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

		{

			cnt_4++ ;

		}

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

		{

			cnt_2++ ;

		}

		else

		{

			cnt_1++ ;

		}

	}

	if(cnt_1>cnt_4+1)

	{

		cout << "No" ;

		return 0 ;

	}

	if(cnt_1==cnt_4+1 && cnt_2>0)

	{

		cout << "No" ;

		return 0 ;

	}

	cout << "Yes" ;

	return 0 ;

}


// Faster C++ solution for the same problem (measured speedup: 5.364135809419724x):




#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>



using namespace std;



int main()

{

	int n;

	cin >> n;

	int a = 0, b = 0;

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

	{

		int x;

		cin >> x;

		if(x % 4 == 2)

		{

			a ++;

		}

		if(x % 4 == 0)

		{

			b ++;

		}

	}

	if(a + b * 2 >= n || b * 2 == n - 1)

	{

		cout << "Yes";

	}

	else

	{

		cout << "No";

	}

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.288008051405821x):




#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 <vector>

#include <queue>

#include <string>

#include <set>

#include <math.h>

#include<algorithm>

using namespace std;







int main()

{

 int n;

 cin>>n;

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

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

 {

     int tmp;

     cin>>tmp;

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

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

     else c++;





 }

 if(n==2)

    {

        if(a==1||a==2)

        {cout<<"Yes"<<endl;return 0;}

        if(b==2)        {cout<<"Yes"<<endl;return 0;}

       cout<<"No"<<endl;return 0;



    }





 if(c==0)  cout<<"Yes"<<endl;

else{

    if(a<c-1) {cout<<"No"<<endl;}

    else {

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

        else 

            {

                if(b==0) cout<<"Yes"<<endl;

                else cout<<"No"<<endl;

            }

    }



}



  return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.303129679280811x):




#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>

using namespace std;

int main()

{

    int n,i,j=0,s=0,m=0;

    cin>>n;

    int a[n];

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

    {   cin>>a[i];

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

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

        else m++;

    }

    if(j>=m||(j-m==-1)&&s==0) cout<<"Yes"<<endl;

    else cout<<"No"<<endl;

    return 0;

}


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

//#define BIG 1000000010

int main(){

	//freopen("_inluckylist.txt","r",stdin);

	int N;

	scanf("%d",&N);

	int i,tmp;

	//int nums[BIG];

	int count1 = 0,count2 = 0;

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

		scanf("%d",&tmp);

		if(tmp%4==0){

			count1 ++;

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

			count2++;

		}

	}

	if(count2 != 0){

		if((count1*2+count2-1)>=N-1){

			printf("Yes\n");

		}else{

			printf("No\n");

		}

	}else {

		if(count1*2 >= N-1){

			printf("Yes\n");

		}else{

			printf("No\n");

		}

	}

	

	

	

	return 0;

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

#define LL long long

using namespace std;



#define maxn 10007

const int INF=0x3f3f3f3f;





int main()

{

    int a,b,c;

    a=b=c=0;

    int n,i,j,k,x,y;

    scanf("%d",&n);

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

    {

        scanf("%d",&x);

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

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

        else a++;

    }

    if(c>=a)

    {

        printf("Yes\n");

        return 0;

    }

    if(c==a-1&&b==0)

    {

        printf("Yes\n");

        return 0;

    }

    printf("No\n");



    return 0;

}


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

//#define BIG 1000000010

int main(){

	//freopen("_inluckylist.txt","r",stdin);

	int N;

	scanf("%d",&N);

	int i,tmp;

	//int nums[BIG];

	int count1 = 0,count2 = 0;

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

		scanf("%d",&tmp);

		if(tmp%4==0){

			count1 ++;

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

			count2++;

		}

	}

	if(count2 != 0){

		if((count1*2+count2-1)>=N-1){

			printf("Yes\n");

		}else{

			printf("No\n");

		}

	}else {

		if(count1*2 >= N-1){

			printf("Yes\n");

		}else{

			printf("No\n");

		}

	}

	

	

	

	return 0;

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

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.279719794602493x):
#include <cstdio>

//#define BIG 1000000010

int main(){

	//freopen("_inluckylist.txt","r",stdin);

	int N;

	scanf("%d",&N);

	int i,tmp;

	//int nums[BIG];

	int count1 = 0,count2 = 0;

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

		scanf("%d",&tmp);

		if(tmp%4==0){

			count1 ++;

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

			count2++;

		}

	}

	if(count2 != 0){

		if((count1*2+count2-1)>=N-1){

			printf("Yes\n");

		}else{

			printf("No\n");

		}

	}else {

		if(count1*2 >= N-1){

			printf("Yes\n");

		}else{

			printf("No\n");

		}

	}

	

	

	

	return 0;

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

#include <stdlib.h>

#include <iostream>

#include <algorithm>

#include <cmath>

#include <cstring>

#include <map>

#include <vector>



using namespace std;



int A[110000];

int cnt1=0;

int cnt2=0;



int main()

{

    int n;

    scanf("%d",&n);

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

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

    

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

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

            cnt1++;

        }

        if(A[i]%2==1)

            cnt2++;

    }

    if(cnt1>=n/2 || cnt1>=cnt2){

        printf("Yes\n");

    }else{

        printf("No\n");

    }



    return 0;

}




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

//#define BIG 1000000010

int main(){

	//freopen("_inluckylist.txt","r",stdin);

	int N;

	scanf("%d",&N);

	int i,tmp;

	//int nums[BIG];

	int count1 = 0,count2 = 0;

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

		scanf("%d",&tmp);

		if(tmp%4==0){

			count1 ++;

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

			count2++;

		}

	}

	if(count2 != 0){

		if((count1*2+count2-1)>=N-1){

			printf("Yes\n");

		}else{

			printf("No\n");

		}

	}else {

		if(count1*2 >= N-1){

			printf("Yes\n");

		}else{

			printf("No\n");

		}

	}

	

	

	

	return 0;

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



using namespace std;



#define pb push_back

#define ff first

#define ss second



typedef long long ll;

const ll MAXN = 2e6 + 10, inf = 1e18, mod = 1e9 + 7;



struct pair_hash {

	template <class T1, class T2>

	std::size_t operator () (const std::pair<T1,T2> &p) const {

		auto h1 = std::hash<T1>{}(p.first);

		auto h2 = std::hash<T2>{}(p.second);



		return h1 ^ h2;  

	}

};



ll pw(ll te, ll tee) {

	if (tee == 0)	return 1;

	ll res = pw(te, tee / 2);

	return (tee % 2 ? te * res * res : res * res);

}



ll n, a[MAXN], t, k, p;



void Read_input() {

	cin >> n;

	for (ll i = 1; i <= n; i++)	cin >> a[i];

}



void Solve() {

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

		if (a[i] % 2)	t++;

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

		else	p++;

	}

	if (k >= t or (p == 0 and k >= t - 1))	cout << "Yes";

	else	cout << "No";

}





int main() {



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

	//freopen("input.txt", "r", stdin),	freopen("output.txt", "w", stdout);



	Read_input(),	Solve();

	return 0;

}

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

//#define BIG 1000000010

int main(){

	//freopen("_inluckylist.txt","r",stdin);

	int N;

	scanf("%d",&N);

	int i,tmp;

	//int nums[BIG];

	int count1 = 0,count2 = 0;

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

		scanf("%d",&tmp);

		if(tmp%4==0){

			count1 ++;

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

			count2++;

		}

	}

	if(count2 != 0){

		if((count1*2+count2-1)>=N-1){

			printf("Yes\n");

		}else{

			printf("No\n");

		}

	}else {

		if(count1*2 >= N-1){

			printf("Yes\n");

		}else{

			printf("No\n");

		}

	}

	

	

	

	return 0;

}
// Slower C++ solution:
//KING NIKAN

#include <bits/stdc++.h>

using namespace std;

typedef long long ll ;

int a[100010] ;

int main() 

{

	ios::sync_with_stdio(false) ;

	cin.tie(0) ;

	cout.tie(0) ;

	int n ;

	cin >> n ;

	int cnt_4=0 ,cnt_2=0 ,cnt_1=0 ;

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

	{

		cin >> a[i] ;

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

		{

			cnt_4++ ;

		}

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

		{

			cnt_2++ ;

		}

		else

		{

			cnt_1++ ;

		}

	}

	if(cnt_1>cnt_4+1)

	{

		cout << "No" ;

		return 0 ;

	}

	if(cnt_1==cnt_4+1 && cnt_2>0)

	{

		cout << "No" ;

		return 0 ;

	}

	cout << "Yes" ;

	return 0 ;

}


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

//#define BIG 1000000010

int main(){

	//freopen("_inluckylist.txt","r",stdin);

	int N;

	scanf("%d",&N);

	int i,tmp;

	//int nums[BIG];

	int count1 = 0,count2 = 0;

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

		scanf("%d",&tmp);

		if(tmp%4==0){

			count1 ++;

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

			count2++;

		}

	}

	if(count2 != 0){

		if((count1*2+count2-1)>=N-1){

			printf("Yes\n");

		}else{

			printf("No\n");

		}

	}else {

		if(count1*2 >= N-1){

			printf("Yes\n");

		}else{

			printf("No\n");

		}

	}

	

	

	

	return 0;

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



using namespace std;



int main()

{

	int n;

	cin >> n;

	int a = 0, b = 0;

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

	{

		int x;

		cin >> x;

		if(x % 4 == 2)

		{

			a ++;

		}

		if(x % 4 == 0)

		{

			b ++;

		}

	}

	if(a + b * 2 >= n || b * 2 == n - 1)

	{

		cout << "Yes";

	}

	else

	{

		cout << "No";

	}

	return 0;

}

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

//#define BIG 1000000010

int main(){

	//freopen("_inluckylist.txt","r",stdin);

	int N;

	scanf("%d",&N);

	int i,tmp;

	//int nums[BIG];

	int count1 = 0,count2 = 0;

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

		scanf("%d",&tmp);

		if(tmp%4==0){

			count1 ++;

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

			count2++;

		}

	}

	if(count2 != 0){

		if((count1*2+count2-1)>=N-1){

			printf("Yes\n");

		}else{

			printf("No\n");

		}

	}else {

		if(count1*2 >= N-1){

			printf("Yes\n");

		}else{

			printf("No\n");

		}

	}

	

	

	

	return 0;

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

#include <vector>

#include <queue>

#include <string>

#include <set>

#include <math.h>

#include<algorithm>

using namespace std;







int main()

{

 int n;

 cin>>n;

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

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

 {

     int tmp;

     cin>>tmp;

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

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

     else c++;





 }

 if(n==2)

    {

        if(a==1||a==2)

        {cout<<"Yes"<<endl;return 0;}

        if(b==2)        {cout<<"Yes"<<endl;return 0;}

       cout<<"No"<<endl;return 0;



    }





 if(c==0)  cout<<"Yes"<<endl;

else{

    if(a<c-1) {cout<<"No"<<endl;}

    else {

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

        else 

            {

                if(b==0) cout<<"Yes"<<endl;

                else cout<<"No"<<endl;

            }

    }



}



  return 0;

}

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

//#define BIG 1000000010

int main(){

	//freopen("_inluckylist.txt","r",stdin);

	int N;

	scanf("%d",&N);

	int i,tmp;

	//int nums[BIG];

	int count1 = 0,count2 = 0;

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

		scanf("%d",&tmp);

		if(tmp%4==0){

			count1 ++;

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

			count2++;

		}

	}

	if(count2 != 0){

		if((count1*2+count2-1)>=N-1){

			printf("Yes\n");

		}else{

			printf("No\n");

		}

	}else {

		if(count1*2 >= N-1){

			printf("Yes\n");

		}else{

			printf("No\n");

		}

	}

	

	

	

	return 0;

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

using namespace std;

int main()

{

    int n,i,j=0,s=0,m=0;

    cin>>n;

    int a[n];

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

    {   cin>>a[i];

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

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

        else m++;

    }

    if(j>=m||(j-m==-1)&&s==0) cout<<"Yes"<<endl;

    else cout<<"No"<<endl;

    return 0;

}


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

#include<cstring>

//long long

const int len = 1e5 + 5;

int a[len],cnt[5],N;



int main(void)

{

	scanf("%d", &N);

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

	{

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

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

			++cnt[4];

		else if (!(a[i] & 01))

			++cnt[2];

		else

			++ cnt[1];

	}

	if (cnt[2] == 0 && cnt[4] >= cnt[1] - 1)

		printf("Yes");

	else if (cnt[4] >= cnt[1])

		printf("Yes");

	else

		printf("No");

	return 0;

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

#define LL long long

using namespace std;



#define maxn 10007

const int INF=0x3f3f3f3f;





int main()

{

    int a,b,c;

    a=b=c=0;

    int n,i,j,k,x,y;

    scanf("%d",&n);

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

    {

        scanf("%d",&x);

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

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

        else a++;

    }

    if(c>=a)

    {

        printf("Yes\n");

        return 0;

    }

    if(c==a-1&&b==0)

    {

        printf("Yes\n");

        return 0;

    }

    printf("No\n");



    return 0;

}


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

#include<cstring>

//long long

const int len = 1e5 + 5;

int a[len],cnt[5],N;



int main(void)

{

	scanf("%d", &N);

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

	{

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

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

			++cnt[4];

		else if (!(a[i] & 01))

			++cnt[2];

		else

			++ cnt[1];

	}

	if (cnt[2] == 0 && cnt[4] >= cnt[1] - 1)

		printf("Yes");

	else if (cnt[4] >= cnt[1])

		printf("Yes");

	else

		printf("No");

	return 0;

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

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.291620317027037x):
#include<cstdio>

#include<cstring>

//long long

const int len = 1e5 + 5;

int a[len],cnt[5],N;



int main(void)

{

	scanf("%d", &N);

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

	{

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

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

			++cnt[4];

		else if (!(a[i] & 01))

			++cnt[2];

		else

			++ cnt[1];

	}

	if (cnt[2] == 0 && cnt[4] >= cnt[1] - 1)

		printf("Yes");

	else if (cnt[4] >= cnt[1])

		printf("Yes");

	else

		printf("No");

	return 0;

}