stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#include<cstdio>

#include<string>

#include<cstring>

#include<iostream>

#include<algorithm>

using namespace std;



long long a,b,x;



int main()

{

	//fuck

	cin>>a>>b>>x;

	long long ans=(b/x)-(a%x?a/x:a/x-1);

	printf("%lld\n",ans);

}

// Optimized solution to the same problem (faster):
#include<stdio.h>



int main(){

	long long a,b,md;

	long long c;

	scanf("%lld %lld %lld", &a,&b,&md);

	if(a%md==0){

		if(a==0)

		{

			c=b/md+1;

		}

		else

		{

			c=(b/md)-(a-1)/md;

		}	

	}

	else

	{

		c=b/md-a/md;

	}

	printf("%lld\n", c);

	

	

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<string>

#include<vector>

#include<algorithm>

#include<cmath>

#include<cstdio>

#include<queue>

#define ll long long

#define PI 2*acos(0.0)

using namespace std;



int main()

{



   // int i,j,k,m,n,val,t=0,test;

    ll a,x,y,ans1,ans2;

    cin>>x>>y>>a;

    if(x==0){

        ans1=0;

        ans2=(y/a)+1;

    }

    else ans1=(x-1)/a,ans2=y/a;;





    cout<<ans2-ans1<<endl;



    //free();   //if pointer array

    return 0;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>



int main(){

	long long a,b,md;

	long long c;

	scanf("%lld %lld %lld", &a,&b,&md);

	if(a%md==0){

		if(a==0)

		{

			c=b/md+1;

		}

		else

		{

			c=(b/md)-(a-1)/md;

		}	

	}

	else

	{

		c=b/md-a/md;

	}

	printf("%lld\n", c);

	

	

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<cstdio>

#include<cstring>

#include<cstdlib>

#include<string>

#include<algorithm>

#include<iostream>

#include<stack>

#include<queue>

#include<map>

#include<cmath>

const int maxn = 5e5 + 5;

using namespace std;



long long a,b,x;



int main(){

	scanf("%lld %lld %lld",&a, &b, &x);

	if(a % x == 0 && b % x == 0 && a == b) printf("1\n");

	else if(a == 0 && b != 0) printf("%lld\n", b / x + 1);

	else printf("%lld\n", b / x - (a - 1) / x);

	return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>



int main(){

	long long a,b,md;

	long long c;

	scanf("%lld %lld %lld", &a,&b,&md);

	if(a%md==0){

		if(a==0)

		{

			c=b/md+1;

		}

		else

		{

			c=(b/md)-(a-1)/md;

		}	

	}

	else

	{

		c=b/md-a/md;

	}

	printf("%lld\n", c);

	

	

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

using namespace std;

int main(){

	long long a ,b,x;



	cin>>a>>b>>x;

	if(a%x ==0 )

	cout<<((b/x)-((a)/x) )+1;

	else

	cout<<(b/x)-((a)/x);

}

// Optimized solution to the same problem (faster):
#include<stdio.h>



int main(){

	long long a,b,md;

	long long c;

	scanf("%lld %lld %lld", &a,&b,&md);

	if(a%md==0){

		if(a==0)

		{

			c=b/md+1;

		}

		else

		{

			c=(b/md)-(a-1)/md;

		}	

	}

	else

	{

		c=b/md-a/md;

	}

	printf("%lld\n", c);

	

	

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

using namespace std;

int main(){

	long long a,b,x;



	cin>>a>>b>>x;

	if(a%x==0)

	cout<<((b/x)-(a/x)+1);

	else

	cout<<(b/x)-(a/x);

}

// Optimized solution to the same problem (faster):
#include<stdio.h>



int main(){

	long long a,b,md;

	long long c;

	scanf("%lld %lld %lld", &a,&b,&md);

	if(a%md==0){

		if(a==0)

		{

			c=b/md+1;

		}

		else

		{

			c=(b/md)-(a-1)/md;

		}	

	}

	else

	{

		c=b/md-a/md;

	}

	printf("%lld\n", c);

	

	

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

int main()

{

	long long a,b,x,w;

	scanf("%lld%lld%lld",&a,&b,&x);

	if(a==0)

	w=(b/x)+1;

	else{

		w=(b/x)-(a-1)/x;

	}

	cout<<w;

	

}

// Optimized solution to the same problem (faster):
#include<stdio.h>



int main(){

	long long a,b,md;

	long long c;

	scanf("%lld %lld %lld", &a,&b,&md);

	if(a%md==0){

		if(a==0)

		{

			c=b/md+1;

		}

		else

		{

			c=(b/md)-(a-1)/md;

		}	

	}

	else

	{

		c=b/md-a/md;

	}

	printf("%lld\n", c);

	

	

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main(){

long long a;

long long b;

long long c;

long long n=0;

cin>>a>>b>>c;

n=(b/c)-(a/c);

if(a%c==0)

++n;

cout<<n;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>



int main(){

	long long a,b,md;

	long long c;

	scanf("%lld %lld %lld", &a,&b,&md);

	if(a%md==0){

		if(a==0)

		{

			c=b/md+1;

		}

		else

		{

			c=(b/md)-(a-1)/md;

		}	

	}

	else

	{

		c=b/md-a/md;

	}

	printf("%lld\n", c);

	

	

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main()

{

	long long a,b,x,r;

	scanf("%lld%lld%lld",&a,&b,&x);

	if(a==0)

	{

		r=(b/x)+1;

	}	else

		r=(b/x)-(a-1)/x;

		

		printf("%lld",r);

		return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>



int main(){

	long long a,b,md;

	long long c;

	scanf("%lld %lld %lld", &a,&b,&md);

	if(a%md==0){

		if(a==0)

		{

			c=b/md+1;

		}

		else

		{

			c=(b/md)-(a-1)/md;

		}	

	}

	else

	{

		c=b/md-a/md;

	}

	printf("%lld\n", c);

	

	

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

using namespace std;

int main(){

	long long a,b,x,d;

	cin>>a>>b>>x;

	if(a==0){

		d=(b/x)+1;

		

	}else{

	

	d=(b/x)-(a-1)/x;}

	cout<<d;

} 

// Optimized solution to the same problem (faster):
#include<stdio.h>



int main(){

	long long a,b,md;

	long long c;

	scanf("%lld %lld %lld", &a,&b,&md);

	if(a%md==0){

		if(a==0)

		{

			c=b/md+1;

		}

		else

		{

			c=(b/md)-(a-1)/md;

		}	

	}

	else

	{

		c=b/md-a/md;

	}

	printf("%lld\n", c);

	

	

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

long long int solve()

{

    long long int a,b,res,x;

    scanf("%lld %lld %lld",&a,&b,&x);

    res=b/x;

    if(a==0)

    {

        return res+1;

    }

    return res-((a-1)/x);

}

int main()

{

    long long int r=solve();

    cout<<r<<endl;

    return 0;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>



int main(){

	long long a,b,md;

	long long c;

	scanf("%lld %lld %lld", &a,&b,&md);

	if(a%md==0){

		if(a==0)

		{

			c=b/md+1;

		}

		else

		{

			c=(b/md)-(a-1)/md;

		}	

	}

	else

	{

		c=b/md-a/md;

	}

	printf("%lld\n", c);

	

	

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

using namespace std;

int main()

{

	long long a,b,x,ans;

	scanf("%lld%lld%lld",&a,&b,&x);

	if(a==0){

		ans=(b/x)+1;}

	else

	{

		ans=((b/x)-(a-1)/x);

	}

	cout<<ans;

	return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>



int main(){

	long long a,b,md;

	long long c;

	scanf("%lld %lld %lld", &a,&b,&md);

	if(a%md==0){

		if(a==0)

		{

			c=b/md+1;

		}

		else

		{

			c=(b/md)-(a-1)/md;

		}	

	}

	else

	{

		c=b/md-a/md;

	}

	printf("%lld\n", c);

	

	

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include<stdio.h>

using namespace std;

int main(){

long long a,b,x;

scanf("%lld%lld%lld",&a,&b,&x);

if (a==0)

cout<<(b/x)+1;

else

cout<<(b/x-(a-1)/x);

}


// Optimized solution to the same problem (faster):
#include<stdio.h>



int main(){

	long long a,b,md;

	long long c;

	scanf("%lld %lld %lld", &a,&b,&md);

	if(a%md==0){

		if(a==0)

		{

			c=b/md+1;

		}

		else

		{

			c=(b/md)-(a-1)/md;

		}	

	}

	else

	{

		c=b/md-a/md;

	}

	printf("%lld\n", c);

	

	

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main()

{

    long long int a,b,x,i,B;

    cin>>a>>b>>x;



    if(a%x==0)

    {

        B=((b/x)-(a/x))+1;

        cout<<B<<endl;

    }

    else

    {

         B=((b/x)-(a/x));

        cout<<B<<endl;

    }

    return 0;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>



int main(){

	long long a,b,md;

	long long c;

	scanf("%lld %lld %lld", &a,&b,&md);

	if(a%md==0){

		if(a==0)

		{

			c=b/md+1;

		}

		else

		{

			c=(b/md)-(a-1)/md;

		}	

	}

	else

	{

		c=b/md-a/md;

	}

	printf("%lld\n", c);

	

	

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

const int N=1e5+5;

int a[N];

int main()

{

    int n;

    cin>>n;

    int cnt4=0,cnt2=0;

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

    {

        cin>>a[i];

        a[i]%=4;

        if(a[i]==0)

            cnt4++;

        else if(a[i]==2)

            cnt2++;

    }

    int cnt=n-cnt2-cnt4;

    if(cnt2)

    {

        if(cnt4>=cnt){

            cout<<"Yes";

            return 0;

        }

    }

    else

    {

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

            cout<<"Yes";

            return 0;

        }

    }

    cout<<"No";

    return 0;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include "bits/stdc++.h"

using namespace std;

typedef long long ll;

typedef pair<int, int> pii;

typedef pair<ll, ll> pll;

const int INF = 1e9;

const ll LINF = 1e18;



/*

<url:https://arc080.contest.atcoder.jp/tasks/arc080_a>

問題文============================================================

 長さ N の数列 a=(a1,a2,…,aN) があります。 各 ai は正の整数です。

 

 すぬけ君の目標は、a の要素を自由に並べ替え、次の条件が成り立つようにすることです。

 

 各 1≤i≤N−1 について、ai と ai+1 の積は 4 の倍数である。

 すぬけ君が目標を達成できるか判定してください。



=================================================================



解説=============================================================



 まず、4の倍数の数値(4の倍数を v 、４の倍数でない値を x とする）が存在する時

 

 x v x v x v x v ... とおいていけば条件を満たす

 つまり、4の倍数である値の個数を V とすると 2*V 分カバーできる

 

 注意：

     x v x v x v ... x v x

 で数列が終了する時 2*V + 1 ＝＝　N をカバーできる

 

 2*c で　数列全てをカバーできない時, ２の倍数をb とすると

 

 x v x v x v x v ... x v b b b b b b .... b

 

 とおいていけば条件を満たす

 

 よって上の注意ケースを除いて,２の倍数の個数とBとすると

 

 2*V + B >= N

 

 となっていれば条件を満たす



================================================================

*/

int main(void) {

	cin.tie(0); ios::sync_with_stdio(false);

    ll N; cin >> N;

    vector<ll> a(N);

    for(auto & in:a) cin >> in;

    ll four = 0, two = 0;

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

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

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

    }

    two -= four;

    if(four*2 + 1 >= N){

        cout << "Yes" << endl;

        return 0;

    }

    if(four*2 + two >= N){

        cout << "Yes" << endl;

    }else{

        cout << "No" << endl;

    }

	return 0;

}


// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
    #include<bits/stdc++.h>

    using namespace std;

    int n, dp[10000000], c = 0, cnt = 0;

    int main()

    {

      cin >> n;

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

      {

            cin >> dp[i];

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

                  c ++;

            else

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

                  cnt ++;

      }



      if((c + cnt / 2) >= n / 2)

            cout << "Yes";

      else

            cout << "No";

     }


// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>



using namespace std;



int n , a , ch , d;



int main()

{

	cin >> n;

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

	{

		cin >> a;

		if(a % 4 == 0)

			ch++;

		else if(a % 2 == 0)

			d++;

	}

	if(ch >= n / 2)

		cout << "Yes";

	else

	{

		if(d >= n - (ch * 2))

			cout << "Yes";

		else

			cout << "No";

	}

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

const int Maxn=1e5+100;

int n,a,k,out[Maxn];

vector <int> vec1,vec2,vec4;

int main(){

	cin>>n;

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

		cin>>a;

		if(a%4==0)

			vec4.push_back(a);

		else if(a%2==0)

			vec2.push_back(a);

		else

			vec1.push_back(a);

	}

	k=4;

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

		if(k==1){

			if(vec4.size()==0){

				cout<<"No";

				return 0;

			}

			vec4.pop_back();

			k=4;

		}

		else if(k==2){

			if(vec2.size()!=0)

				vec2.pop_back(),k=2;

			else if(vec4.size()!=0)

				vec4.pop_back(),k=4;

			else{

				cout<<"No";

				return 0;

			}

		}

		else if(k==4){

			if(vec1.size()!=0)

				vec1.pop_back(),k=1;

			else if(vec2.size()!=0)

				vec2.pop_back(),k=2;

			else if(vec4.size()!=0)

				vec4.pop_back(),k=4;

		}

	}

	cout<<"Yes";

}


// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <cstdio>

#include <cstring>

#include <cmath>

#include <algorithm>

#include <ctype.h>

#include <vector>

#include <map>

using namespace std;

typedef long long LL;

#define INF 0x3fffffff

#define MAXSIZE 100005

//const double eps=1e-8;

//#define Equ(a,b) ((fabs((a)-(b)))<(eps))

//const double pi=acos(-1.0);



int main(){

    int n;

    int a0=0,a1=0,a2=0;

    scanf("%d",&n);

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

        int b;

        scanf("%d",&b);

        if (b%4==0) {

            a2++;

        }

        else if (b%2==0){

            a1++;

        }

        else{

            a0++;

        }

    }

    if (a1==0&&a2>=a0-1) {

        printf("Yes\n");

    }

    else if (a2>=a0){

        printf("Yes\n");

    }

    else{

        printf("No\n");

    }

    return 0;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

const int N = 1e2+9;

const double pi = acos(-1.0);

#define ll long long

ll dp[N];

ll a[N];

ll n,m,d,x;

int _,__,___;

int main()

{

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

   cin>>n;

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

   {

       int t;

       cin>>t;

       if(t%4==0) _++;

       else if(t%2==0) __++;

       else ___++;

   }

   if(_>=(n>>1) || _ >= ___) cout<<"Yes"<<endl;

   else cout<<"No"<<endl;

    return 0;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

const int N = 1e2+9;

const double pi = acos(-1.0);

#define ll long long

//ll dp[N];

//ll a[N];

ll n,m,d,x;

int _,__,___;

int main()

{

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

  

ios::sync_with_stdio(false);

 cin>>n;

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

   {

       int t;

       cin>>t;

       if(t%4==0) _++;

       else if(t%2==0) __++;

       else ___++;

   }

   if(_>=(n>>1) || _ >= ___) cout<<"Yes"<<endl;

   else cout<<"No"<<endl;

    return 0;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;



int main(){

	int n;cin >> n;

	int cnt = 0,cnt1 = 0, cnt2= 0;

	int a;

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

		cin >> a;

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

		else{

			if(a&1) cnt1++;

			else cnt2++;

		}

	}

	if(cnt2>0 && cnt1<=cnt)

		printf("Yes\n");

	else if(cnt2==0 && cnt1<=cnt+1)

		printf("Yes\n");

	else

		printf("No\n");



	return 0;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>



using namespace std;

typedef pair <int, int> pii;



const int maxn = 100001;



int n,a,q,w,e,s;



void input();

void solve();



int main(){

	input();

	solve();

	

	return 0;

}

void input(){

	cin>>n;

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

		cin>>a;

		if (a%4==0){

			q++;

		}

		else{

			if (a%2==0){

				w++;

			}

			else{

				e++;

			}

		}

		s++;

	}

	

}

void solve(){

	if (w>0){

		e++;

	}

	while(q>=2 and e>=2){

		q-=2;

		e-=2;

	}

	e--;

	if (e>q){

		cout<<"No";

	}

	else{

		cout<<"Yes";

	}

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

using namespace std;



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

{

	int N;

	int ai, a1, a2, a4;



	a1 = a2 = a4 = 0;

	cin >> N;



	while(N--)

	{

		cin >> ai;

		if(ai % 4 == 0)

			a4++;

		else if(ai % 2 == 0)

			a2++;

		else

			a1++;

	}



	if(a2 == 0 && a4 >= a1-1)

		cout << "Yes";

	else if(a2 != 0 && a4 >= a1)

	{

		if(a4 != 0)

			cout << "Yes";

		else if(a2 > 1)

			cout << "Yes";

		else

			cout << "No";

	}

	else

		cout << "No";

	

	return 0;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int n,ans1=0,ans2=0,temp;

    cin>>n;

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

	{

		cin>>temp;

		if(temp%2==0)

		{

			if(temp%4==0)

				ans1++;

			else

				ans2++;

		}

	} 

	n=n-ans2-ans1;

	if(ans2==0)

	{

		if(n<=ans1+1)

		cout<<"Yes\n";

		else

			cout<<"No\n";

	}

	else

	{

		if(n<=ans1)

		 	cout<<"Yes\n";

		else

			cout<<"No\n";

	}

    return 0;

    

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<cstdio>

using namespace std;



int main(){

	int n,*a,i,k_2=0,k_4=0;

	scanf("%d",&n);

	a=new int[n];

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

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

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

			k_4++;

		}

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

			k_2++;

		}

	}

	if(k_4>=n/2){

		printf("Yes");

	}

	else{

		if((2*k_4+k_2)>=n){

			printf("Yes");

		}

		else{

			printf("No");

		}

	}

	return 0;

	system("pause");

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem: