stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
/*

×¢Òâ·¶Î§£¡

short·¶Î§£º-32768~32767

unsigned short·¶Î§£º0~65535

int·¶Î§£º-2147483648~2147483647

uint·¶Î§£º0~4294967295

INT·¶Î§£º-9223372036854775808~9223372036854775807

UINT·¶Î§£º0~18446744073709551615

float·¶Î§£º-3.4e38~3.4e38£¬¾«¶È£º6~7Î»

double·¶Î§£º-1.7e308~1.7e308£¬¾«¶È£º15~16Î»

ldouble·¶Î§£º-1.2e4932~1.2e4932£¬¾«¶È£º18~19Î»

*/

#include <algorithm>

#include <bitset>

#include <cassert>

#include <cctype>

#include <cmath>

#include <complex>

#include <cstdio>

#include <cstdlib>

#include <cstring>

#include <ctime>

#include <deque>

#include <fstream>

#include <functional>

#include <iomanip>

#include <iostream>

#include <list>

#include <map>

#include <numeric>

#include <queue>

#include <set>

#include <sstream>

#include <stack>

#include <string>

#include <utility>

#include <vector>

#define LL long long

#define pb push_back

#define pob pop_back

#define mp make_pair

#define FILL(a,v) memset((void*)a,v,sizeof(a))

#define FILL0(a) FILL(a,0)

#define FILL1(a) FILL(a,-1)

#define ALL(a) (a).begin(),(a).end()

#define Inf 1e9

#define Mod 1000000007

#define foreach(it,x) for(typeof(x.begin()) it=x.begin();it!=x.end();it++)

#define FOR(i,x) for(int i=0;i<x;i++)

#define RFOR(i,x) for(int i=x-1;i>=0;i--)

#define FFOR(i,a,b) for(int i=a;i<b;i++)

#define FRFOR(i,a,b) for(int i=a-1;i>=b;i--)

#define SZ(a) ((int)(a).size())

#define FI first

#define SE second

#define OVER(a) return puts(a),0

#define fastio ios::sync_with_stdio(0)

#define filei(f) freopen(f,"r",stdin)

#define fileo(f) freopen(f,"w",stdout)

using namespace std;

typedef pair<int,int> pii;

typedef unsigned long long UINT;

typedef unsigned int Uint;

typedef long long INT;

typedef pair<INT,INT> PII;

typedef vector<int> vint;

typedef vector<INT> VINT;

typedef vector<pii> vpii;

typedef vector<PII> VPII;

typedef greater<int> gint;

typedef greater<INT> GINT;

typedef greater<pii> gpii;

typedef greater<PII> GPII;



int n,a[100007],mn[4];



int main()

{

	scanf("%d",&n);

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

	{

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

		a[i]%=4;

		mn[a[i]]++;

	}

	if(mn[1]+mn[3]<=mn[0])OVER("Yes");

	else if(mn[1]+mn[3]+mn[0]==n&&mn[1]+mn[3]<=mn[0]+1)OVER("Yes");

	else OVER("No");

}

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

int main()

{

	int n;

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

	{

		int four = 0, two = 0,x=0;

		int a;

		while (n--)

		{

			scanf("%d", &a);

			if (a % 4==0)

			{

				four++;

				continue;

			}

			if (a % 2 == 0)

			{

				two++;

				continue;

			}

			x++;

		}

		if (two)

			x++;

		if (four + 1 < x)

			printf("No\n");

		else

			printf("Yes\n");

	}

	return 0;

}

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

using namespace std;

int a[100010];

int num[100010];



int main()

{

	int l,r,i,j,n;

	int x0=0,x1=0,x2=0;

	ios::sync_with_stdio(false);

	cin>>n;

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

	{

		cin>>a[i];

		while(a[i]%2==0&&a[i]!=0)

		{

			a[i]/=2;

			num[i]++;

		}

		if(num[i]==0) x0++;

		else if(num[i]==1) x1++;

		else x2++;

	}

	l=x0;

	if(x1>0) l++;

	r=x2;

	if(r+1>=l) cout<<"Yes\n";

	else cout<<"No\n";

	return 0;

}

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

int main()

{

	int n;

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

	{

		int four = 0, two = 0,x=0;

		int a;

		while (n--)

		{

			scanf("%d", &a);

			if (a % 4==0)

			{

				four++;

				continue;

			}

			if (a % 2 == 0)

			{

				two++;

				continue;

			}

			x++;

		}

		if (two)

			x++;

		if (four + 1 < x)

			printf("No\n");

		else

			printf("Yes\n");

	}

	return 0;

}

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



using namespace std;



const int maxn = 1e5 + 7;

int main(){

    int n, num2 = 0, num4 = 0;

    scanf("%d", &n);

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

        int x;

        scanf("%d", &x);

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

        if(x % 2 == 0) num2++;

    }

    num2 -= num4;

    if(num2 > 0)

    n -= num2 - 1;

    if(num4 >= n / 2) puts("Yes");

    else puts("No");

    return 0;

}


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

int main()

{

	int n;

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

	{

		int four = 0, two = 0,x=0;

		int a;

		while (n--)

		{

			scanf("%d", &a);

			if (a % 4==0)

			{

				four++;

				continue;

			}

			if (a % 2 == 0)

			{

				two++;

				continue;

			}

			x++;

		}

		if (two)

			x++;

		if (four + 1 < x)

			printf("No\n");

		else

			printf("Yes\n");

	}

	return 0;

}

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

#include <cstring>

using namespace std;



int mp[3];

int n, x;



int main() {

	ios::sync_with_stdio(false);

	while (cin >> n) {

		memset(mp, 0, sizeof(mp));

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

			cin >> x;

			if (x % 4 == 0)

				mp[2]++;

			else if (x % 2 == 0)

				mp[1]++;

			else

				mp[0]++;

		}

		if (mp[1] > 0)

			mp[0]++;

		if (mp[0] - 1 > mp[2])

			cout << "No\n";

		else

			cout << "Yes\n";

	}

	return 0;

}

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

int main()

{

	int n;

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

	{

		int four = 0, two = 0,x=0;

		int a;

		while (n--)

		{

			scanf("%d", &a);

			if (a % 4==0)

			{

				four++;

				continue;

			}

			if (a % 2 == 0)

			{

				two++;

				continue;

			}

			x++;

		}

		if (two)

			x++;

		if (four + 1 < x)

			printf("No\n");

		else

			printf("Yes\n");

	}

	return 0;

}

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

#include <iostream>

#include <string.h>

#include <stdio.h>

using namespace std;



int a[100005];



int main()

{

    int n , x, y;

    cin >> n;

    bool flag = false;

    x = y = 0;

    for(int i = 0; i < n; i++) cin>>a[i];

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

    {

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

            x++;

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

            y++;

        if(x * 2 + y >= n || x >= n / 2)

            flag = true;

    }

    if(flag) puts("Yes");

    else puts("No");

    return 0;

}


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

int main()

{

	int n;

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

	{

		int four = 0, two = 0,x=0;

		int a;

		while (n--)

		{

			scanf("%d", &a);

			if (a % 4==0)

			{

				four++;

				continue;

			}

			if (a % 2 == 0)

			{

				two++;

				continue;

			}

			x++;

		}

		if (two)

			x++;

		if (four + 1 < x)

			printf("No\n");

		else

			printf("Yes\n");

	}

	return 0;

}

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



using namespace std;

int a[100005];

int main()

{

    int N;

    while(cin>>N)

    {

        int mo2=0;

        int mo1=0;

        int mo4=0;

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

        {

            cin>>a[i];

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

            {

                mo4++;

            }

            else

            {

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

                    mo2++;

                else

                    mo1++;

            }

        }

        if(mo2!=0)

        {

            mo1++;

        }

        if(mo4>=mo1-1)

        {

            cout<<"Yes"<<endl;

        }

        else

        {

            cout<<"No"<<endl;

        }



    }

    return 0;

}


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

int main()

{

	int n;

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

	{

		int four = 0, two = 0,x=0;

		int a;

		while (n--)

		{

			scanf("%d", &a);

			if (a % 4==0)

			{

				four++;

				continue;

			}

			if (a % 2 == 0)

			{

				two++;

				continue;

			}

			x++;

		}

		if (two)

			x++;

		if (four + 1 < x)

			printf("No\n");

		else

			printf("Yes\n");

	}

	return 0;

}

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

using namespace std;

int main()

{

    int n;

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

    {

        int cnte = 0, cnt4 = 0, cnt2 = 0;

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

        {

            int num;

            scanf("%d", &num);

            if (num % 2) cnte++;

            else if (num % 4) cnt2++;

            else cnt4++;

        }

        if (cnt2 == 0)

        {

            if (cnt4 >= cnte - 1)printf("Yes\n");

            else printf("No\n");

        }

        else if(cnt4>=cnte)printf("Yes\n");

        else printf("No\n");

    }

    return 0;

}

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

int main()

{

	int n;

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

	{

		int four = 0, two = 0,x=0;

		int a;

		while (n--)

		{

			scanf("%d", &a);

			if (a % 4==0)

			{

				four++;

				continue;

			}

			if (a % 2 == 0)

			{

				two++;

				continue;

			}

			x++;

		}

		if (two)

			x++;

		if (four + 1 < x)

			printf("No\n");

		else

			printf("Yes\n");

	}

	return 0;

}

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

#define max(a,b) ((a>b)?(a):(b))

#define min(a,b) ((a<b)?(a):(b))

#define MEM(a,b) memset(a,b,sizeof(a))

using namespace std;

typedef long long LL;

typedef pair<int,int>pii;

const int mod = 1e9 + 7;

int a[200200];

int main() {

    int n, x;

    scanf("%d", &n);

    int four = 0;

    int two = 0;

    int not_four = 0;

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

        scanf("%d", &x);

        if(x % 2 == 0 && x % 4 != 0) two++;

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

        else not_four++;

    }

    if(two == 0) {

        if(four + 1 < not_four) puts("No");

        else puts("Yes");

    } else {

        if(four < not_four) puts("No");

        else puts("Yes");

    }

}


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

int main()

{

	int n;

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

	{

		int four = 0, two = 0,x=0;

		int a;

		while (n--)

		{

			scanf("%d", &a);

			if (a % 4==0)

			{

				four++;

				continue;

			}

			if (a % 2 == 0)

			{

				two++;

				continue;

			}

			x++;

		}

		if (two)

			x++;

		if (four + 1 < x)

			printf("No\n");

		else

			printf("Yes\n");

	}

	return 0;

}

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

using namespace std;

int main(){

	int n,m,count,c2;

	while (cin>>n){

		count=0;

		c2=0;

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

	    	cin>>m;

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

	    	if (m%2==0&&m/2%2!=0)c2++;

		}

		   int c1=n-count-c2;

		   if ((c2&&count>=c1)||(c2==0&&count>=c1-1))cout<<"Yes"<<endl;

		   else cout<<"No"<<endl;

	}

	return 0;

}

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

int main()

{

	int n;

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

	{

		int four = 0, two = 0,x=0;

		int a;

		while (n--)

		{

			scanf("%d", &a);

			if (a % 4==0)

			{

				four++;

				continue;

			}

			if (a % 2 == 0)

			{

				two++;

				continue;

			}

			x++;

		}

		if (two)

			x++;

		if (four + 1 < x)

			printf("No\n");

		else

			printf("Yes\n");

	}

	return 0;

}

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

#include<algorithm>

using namespace std;

const int maxn=1e5+5;

int n;

long long a[maxn];

int main(){

	cin>>n;

	//long long x,sum=1;

	//bool f=1;

	for(int i=0;i<n;i++)cin>>a[i];

	int x=0,y=0,z=0;

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

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

		else if(a[i]%2==0)y++,z++;

		else z++;

	}

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

	if(z==y)cout<<"Yes"<<endl;

	else{

		if(y%2==0)z-=y;

		else z=z-y+1;

		if(x>=z-1)cout<<"Yes"<<endl;

		else cout<<"No"<<endl;

	}

	//else if(x>=z-y/2-1)cout<<"Yes"<<endl;

	//else cout<<"No"<<endl;

	/*for(int i=n-1;i>=0;i--){

		sum*=x;

		if(sum%4){

			cout<<"No"<<endl;

			f=0;

			break;

		}

		sum%=4;

	}

	if(f)cout<<"Yes"<<endl;*/

	return 0;

}

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

int main()

{

	int n;

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

	{

		int four = 0, two = 0,x=0;

		int a;

		while (n--)

		{

			scanf("%d", &a);

			if (a % 4==0)

			{

				four++;

				continue;

			}

			if (a % 2 == 0)

			{

				two++;

				continue;

			}

			x++;

		}

		if (two)

			x++;

		if (four + 1 < x)

			printf("No\n");

		else

			printf("Yes\n");

	}

	return 0;

}

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

#include<stdio.h>

#include<string>

#include<cmath>

#include<algorithm>

using namespace std;

const int maxn=100005;

const int mod=1000007;

const double eps=1e-3;

struct node

{

        int data;

        int cnt;

        bool operator < (const node &s) const

        {

                        return cnt<s.cnt;

        }

}a[maxn];

int main()

{

        int temp,n;

        bool f=false;

        bool if1=false;

        bool if0=false;

        while(cin>>n)

        {

                int cnt0=0;

                int cnt2=0;

                f=false;

                if0=false;

                if1=false;

                bool exist1=false;

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

                {

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

                        a[i].cnt=0;

                        temp=a[i].data;

                        while(temp%2==0)

                        {

                                a[i].cnt++;

                                temp>>=1;

                                //cout<<temp<<' '<<a[i].cnt<<endl;

                                if(a[i].cnt>=2) break;

                        }

                        if(a[i].cnt==0)

                        {

                                cnt0++;

                        }

                        if(a[i].cnt==2)

                        {

                                cnt2++;

                        }

                        if(a[i].cnt==1)

                        {

                                exist1=true;

                        }

                        //cout<<cnt0<<' '<<cnt2<<' '<<exist1<<endl;

                }

                //cout<<cnt0<<' '<<cnt2<<' '<<exist1<<endl;

                if((cnt2<cnt0-1)||(cnt2==cnt0-1&&exist1))

                        printf("No\n");

                else

                {

                        printf("Yes\n");

                }

        }

	//system("pause");

	return 0;

}


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

int main()

{

	int n;

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

	{

		int four = 0, two = 0,x=0;

		int a;

		while (n--)

		{

			scanf("%d", &a);

			if (a % 4==0)

			{

				four++;

				continue;

			}

			if (a % 2 == 0)

			{

				two++;

				continue;

			}

			x++;

		}

		if (two)

			x++;

		if (four + 1 < x)

			printf("No\n");

		else

			printf("Yes\n");

	}

	return 0;

}

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

#include <cstdio>

#include <cstring>

#include <algorithm>

#include <vector>

using namespace std;

#define LL long long



int n, num2;

int num4;

int a[100005];



int main()

{

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

    {

        num2 = 0, num4 = 0;

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

        {

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

            if(a[i] % 2 == 0 && a[i] % 4 != 0) num2++;

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

        }

        if(num2 + num4 == n)

        {

            printf("Yes\n");

            continue;

        }

        if(num2 >= 2)

        {

            n -= num2;

            if(n % 2 == 1) n++;

        }

        if(num4 >= n / 2)

        {

            printf("Yes\n");

            continue;

        }

        printf("No\n");

    }

}


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

int main()

{

	int n;

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

	{

		int four = 0, two = 0,x=0;

		int a;

		while (n--)

		{

			scanf("%d", &a);

			if (a % 4==0)

			{

				four++;

				continue;

			}

			if (a % 2 == 0)

			{

				two++;

				continue;

			}

			x++;

		}

		if (two)

			x++;

		if (four + 1 < x)

			printf("No\n");

		else

			printf("Yes\n");

	}

	return 0;

}

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

using namespace std;



typedef map<int,int>mpii;



#define fast ios_base::sync_with_stdio(0)



int main()

{

    fast;

    // let odd = b1, even not divisible by 4 = b2, divisible by 4 = b4

    int x, i , N , b4=0 , b2=0, b1=0;

    cin >> N;

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

    {

        cin >> x;



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

        else if(x % 2 == 0) b2+=1;

        else if(x % 2 != 0) b1+=1;

    }



    if(b2 == 0)

    {

        if(b1 <= b4+1) cout << "Yes\n";

        else cout << "No\n";

    }



    if(b2 > 0)

    {

        if(b1 <= b4) cout << "Yes\n";

        else cout << "No\n";

    }



    return 0;

}


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

int main()

{

	int n;

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

	{

		int four = 0, two = 0,x=0;

		int a;

		while (n--)

		{

			scanf("%d", &a);

			if (a % 4==0)

			{

				four++;

				continue;

			}

			if (a % 2 == 0)

			{

				two++;

				continue;

			}

			x++;

		}

		if (two)

			x++;

		if (four + 1 < x)

			printf("No\n");

		else

			printf("Yes\n");

	}

	return 0;

}

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

using namespace std;

typedef long long ll;

const int MAXSIZE=30000020;

int bufpos;

char buf[MAXSIZE];

#define NEG 0

void init(){

	#ifdef LOCAL

		freopen("C.txt","r",stdin);

	#endif

	buf[fread(buf,1,MAXSIZE,stdin)]='\0';

	bufpos=0;

}

#if NEG

int readint(){

	bool isneg;

	int val=0;

	for(;!isdigit(buf[bufpos]) && buf[bufpos]!='-';bufpos++);

	bufpos+=(isneg=buf[bufpos]=='-');

	for(;isdigit(buf[bufpos]);bufpos++)

		val=val*10+buf[bufpos]-'0';

	return isneg?-val:val;

}

#else

int readint(){

	int val=0;

	for(;!isdigit(buf[bufpos]);bufpos++);

	for(;isdigit(buf[bufpos]);bufpos++)

		val=val*10+buf[bufpos]-'0';

	return val;

}

#endif

char readchar(){

	for(;isspace(buf[bufpos]);bufpos++);

	return buf[bufpos++];

}

int readstr(char* s){

	int cur=0;

	for(;isspace(buf[bufpos]);bufpos++);

	for(;!isspace(buf[bufpos]);bufpos++)

		s[cur++]=buf[bufpos];

	s[cur]='\0';

	return cur;

}

int a[100002];

int main(){

	init();

	int n=readint(),cnt=0,cnt1=0,cnt2=0;

	while(n--){

		int x=readint();

		if (x%4==0)

			cnt2++;

		else if (x%2==0)

			cnt1++;

		else cnt++;

	}

	int to=cnt2;

	if (!cnt1)

		to++;

	if (cnt>to)

		puts("No");

	else puts("Yes");

}

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

int main()

{

	int n;

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

	{

		int four = 0, two = 0,x=0;

		int a;

		while (n--)

		{

			scanf("%d", &a);

			if (a % 4==0)

			{

				four++;

				continue;

			}

			if (a % 2 == 0)

			{

				two++;

				continue;

			}

			x++;

		}

		if (two)

			x++;

		if (four + 1 < x)

			printf("No\n");

		else

			printf("Yes\n");

	}

	return 0;

}

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

#include <stdio.h>

#include <cstdlib>

using namespace std;



const int N = 200000;

int n;

int a[N];



void init()

{

    cin >> n;

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

    {

        cin >> a[i];

    }

}



void solve()

{

    int c4=0,c2=0,c1=0;

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

    {

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

            c4++;

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

            c2++;

        else

            c1++;

    }

    if(c2 > 0)

        c2 = 1;

    if(c1 == 0)

        cout << "Yes" << endl;

    else if(c4 >= c1-1+c2)

        cout << "Yes" << endl;

    else

        cout << "No" << endl;

}



int main()

{

    init();

    solve();

    return 0;

}

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

int main()

{

	int n;

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

	{

		int four = 0, two = 0,x=0;

		int a;

		while (n--)

		{

			scanf("%d", &a);

			if (a % 4==0)

			{

				four++;

				continue;

			}

			if (a % 2 == 0)

			{

				two++;

				continue;

			}

			x++;

		}

		if (two)

			x++;

		if (four + 1 < x)

			printf("No\n");

		else

			printf("Yes\n");

	}

	return 0;

}

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

#include <cstdio>

#include <algorithm>

using namespace std;

int main()

{

	int n;

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

	{

		int a[500001];

		int flag,flag1,flag2;

		flag=flag1=flag2=0;

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

		{

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

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

				flag++;

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

				flag1++;

			else

				flag2++;

		}

		if(flag1)

			flag2++;

		if(flag2<=flag+1)

			printf("Yes\n");

		else

			printf("No\n");

	}

}

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



int main()

{

	int n=0;

	scanf("%d",&n);

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

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

	{

		int input=0;

		scanf("%d",&input);

		if(input&1)

		{

			_1m++;

		}

		else if(input%4==0)

		{

			_4m++;

		}

		else

		{

			_2m++;

		}

	}

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

    else printf("Yes\n");

	

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
// In the name of Allah the Lord of the Worlds.



#include<bits/stdc++.h>

using namespace std;



typedef long long ll;



struct myStruct{



    ll number , fre;



    myStruct(ll _number , ll _fre){



        number = _number;

        fre = _fre;

    }

};



bool operator<(myStruct A , myStruct B)

{



    return A.fre < B.fre;

}



int main(void)

{

    int n;

    scanf("%d",&n);

    vector<myStruct>v;



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



        ll in;

        scanf("%lld",&in);



        ll temp = in , counter = 0;



        while(temp%2==0){



            counter++;

            temp/=2;

        }



        v.push_back(myStruct(in , counter));

    }



    sort(v.begin() , v.end());



    int si = v.size();



    for(int i=0;i<si/2;i++){



        if(v[i].fre+v[si-1-i].fre<2){si = -1; break;}

    }



    if(si==-1)printf("No\n");

    else printf("Yes\n");



    return 0;

}


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



int main()

{

	int n=0;

	scanf("%d",&n);

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

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

	{

		int input=0;

		scanf("%d",&input);

		if(input&1)

		{

			_1m++;

		}

		else if(input%4==0)

		{

			_4m++;

		}

		else

		{

			_2m++;

		}

	}

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

    else printf("Yes\n");

	

	return 0;

}

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

using namespace std;

int n,a,b,x,c;

int main()

{

	scanf("%d",&n);

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

		scanf("%d",&x);

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

		else if(x&1)b++;

		else c++;

	}

	if(!c)b--;

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

	else puts("No");

	return 0;

}

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



int main()

{

	int n=0;

	scanf("%d",&n);

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

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

	{

		int input=0;

		scanf("%d",&input);

		if(input&1)

		{

			_1m++;

		}

		else if(input%4==0)

		{

			_4m++;

		}

		else

		{

			_2m++;

		}

	}

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

    else printf("Yes\n");

	

	return 0;

}

// Fastest known solution for this problem: