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

#include<string.h>

#include<stdlib.h>

#include<sstream>

#include<iostream>

#include<algorithm>

#include<math.h>

#include<vector>

#include<map> //要学会用map 

#include<queue>

#include<stack>

using namespace std;

/*如果a大于0且b大于0，但相加得到的却是小于等于0的说明是正溢出，这时肯定比c大（因为c肯定在long long的范围内）。

如果a小于0且b小于0，但相加得到的却是大于等于0的说明是负溢出，这是肯定比c小。*/

const int maxn = 10001;

int prime[maxn],pNum = 0;

bool p[maxn] = {0};

void Find_Prime()

{

	for(int i=2;i<maxn;i++)

	{

		if(p[i] ==false)

		{

			prime[pNum++]=i;

			for(int j=i+i;j<maxn;j+=i)

			{

				p[j] = true;

			}

		}

	}

}

int main(){

	int n;

	scanf("%d",&n);

	int count = 0;

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

	{

		int temp;

		scanf("%d",&temp);

		if(temp%4==0) count+=2;

		else if(temp%2==0) count+=1;

	}

	if(n%2==0)

	{

		if(count>=n) printf("Yes");

		else printf("No");

	}

	else

	{

		if(count>=n-1) printf("Yes");

		else printf("No");

	}

	return 0;	

}

// Optimized solution to the same problem (faster):
/*#include<cstdio>      最后一个测试点过不了，不知道为什么

const int maxn = 100010;

int luck[maxn] = {0};

int main(){

    int n;

    int countluck = 0;

    int countunluck = 0;

    int counttwo = 0;

    scanf("%d",&n);

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

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

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

            countluck++;

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

            counttwo++;

        }else{

            countunluck++;

        }

    }

    if(counttwo == 0){

        if(countunluck - 1 > countluck){

            printf("No\n");

        }else{

            printf("Yes\n");



        }

    }

    else if (counttwo > 0){

        if(counttwo == 1){

            countunluck++;

        }else{

            countluck +=(counttwo/2);

        }



        if(countunluck-1  > countluck){

            printf("No\n");



        }else{

            printf("Yes\n");



        }

    }





    return 0;

}

*/



#include<cstdio>      

const int maxn = 100010;

int luck[maxn] = {0};

int main(){

    int n;

    int countluck = 0;

    int countunluck = 0;

    int counttwo = 0;

    scanf("%d",&n);

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

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

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

            countluck++;

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

            counttwo++;

        }else{

            countunluck++;

        }

    }

    if(counttwo == 0){

        if(countunluck - 1 > countluck){

            printf("No\n");

        }else{

            printf("Yes\n");



        }

    }

    else if (counttwo > 0){           //将2放在末尾，所以说需要unlucky的数量小于luck的数量

            

        /*if(counttwo == 1){

            countunluck++;

        }else{

            countluck +=(counttwo/2);

        }*/



        if(countunluck > countluck){

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

#include<stdlib.h>

#include<math.h>

#include<algorithm>

#include<string>

#include<stack>

using namespace std;

typedef  long long LL;

const int maxn=505;

char tmp[maxn];

int dp[maxn][maxn];

int max(int a,int b)

{

    if(a<b)

        return b;

    return a;

}

/*LL gcd(LL a,LL b)

{

    if(b==0)

        return a;

    return gcd(b,a%b);

}

LL lcm(LL a,LL b)

{

    return a/gcd(a,b)*b;

}*/



int main()

{

     int n;

     cin>>n;

     int num_4=0;

     int num_2=0;

     int n2=n;

     while(n2--)

     {

         LL m;

         cin>>m;

         if(m%4==0)

            num_4++;

         else if(m%2==0)

         {

             num_2++;

         }



     }

     int sum=0;

     sum=num_4*2+1;

     if(sum>=n)

     {

          cout<<"Yes"<<endl;

     }

     else

     {  sum+=num_2;

     if(sum>n)

        cout<<"Yes"<<endl;

     else

        cout<<"No"<<endl;



     }





    return 0;

}


// Optimized solution to the same problem (faster):
/*#include<cstdio>      最后一个测试点过不了，不知道为什么

const int maxn = 100010;

int luck[maxn] = {0};

int main(){

    int n;

    int countluck = 0;

    int countunluck = 0;

    int counttwo = 0;

    scanf("%d",&n);

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

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

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

            countluck++;

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

            counttwo++;

        }else{

            countunluck++;

        }

    }

    if(counttwo == 0){

        if(countunluck - 1 > countluck){

            printf("No\n");

        }else{

            printf("Yes\n");



        }

    }

    else if (counttwo > 0){

        if(counttwo == 1){

            countunluck++;

        }else{

            countluck +=(counttwo/2);

        }



        if(countunluck-1  > countluck){

            printf("No\n");



        }else{

            printf("Yes\n");



        }

    }





    return 0;

}

*/



#include<cstdio>      

const int maxn = 100010;

int luck[maxn] = {0};

int main(){

    int n;

    int countluck = 0;

    int countunluck = 0;

    int counttwo = 0;

    scanf("%d",&n);

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

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

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

            countluck++;

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

            counttwo++;

        }else{

            countunluck++;

        }

    }

    if(counttwo == 0){

        if(countunluck - 1 > countluck){

            printf("No\n");

        }else{

            printf("Yes\n");



        }

    }

    else if (counttwo > 0){           //将2放在末尾，所以说需要unlucky的数量小于luck的数量

            

        /*if(counttwo == 1){

            countunluck++;

        }else{

            countluck +=(counttwo/2);

        }*/



        if(countunluck > countluck){

            printf("No\n");



        }else{

            printf("Yes\n");



        }

    }





    return 0;

}




















































// Fastest known solution for this problem:
// Original C++ solution (slower):
//#define _CRT_SECURE_NO_WARNINGS

#define LOCAL_CHUNYU



//#include <iostream>

#include <cstdio>

#include <vector>

#include <algorithm>

#include <cstring>	//memset

#include <ctime>

//#include <cmath>





using std::vector;

using std::sort;

using std::swap;



typedef long long LL;

const int maxn = 1e5 + 10;

const int mod = 1e9 + 7;

const double eps = 1e-8;

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



#define equ(a,b) ((fabs((a)-(b))) < (eps))

#define gth(a,b) (((a)-(b)) > (eps))

#define lth(a,b) (((a)-(b)) < (-eps))

#define gequ(a,b) (((a)-(b)) > (-eps))

#define lequ(a,b) (((a)-(b)) < (eps))







int main() {

#ifdef LOCAL_CHUNYU

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

#endif // LOCAL_CHUNYU



//    int N;

//    scanf("%d",&N);

//    int *sample = new int[N];

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

//        scanf("%d",sample + i);

//    }

//    sort(sample, sample + N);

//    int flag = 0;

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

//        int temp = i + 1;

//        int j;

//        for(j = temp; j < N; ++j){

//            if(sample[j] * sample[i] % 4 == 0){

//                if(j == temp)

//                    break;

//                else{

//                    swap(sample[temp], sample[j]);

//                    sort(sample + temp + 1, sample + N);

//                    break;

//                }

//

//            }

//

//        }

//        if(j == N){

//            flag = 1;

//            printf("No\n");

//            break;

//        }

//    }

//    if(flag == 0){

//        printf("Yes\n");

//    }



    int N;

    scanf("%d",&N);

    int *sample = new int[N];

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

        scanf("%d",sample + i);

    }

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

    int temp;

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

        temp = sample[i];

        if(temp % 4 == 0)

            a4++;

        if(temp % 2 == 0 && temp % 4 != 0)

            a2++;

        if(temp % 2 != 0)

            a1++;

    }

    if(a4 >= a1){

        printf("Yes\n");

        return 0;

    }

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

        printf("Yes\n");

        return 0;

    }

    printf("No\n");











	return 0;

}


// Optimized solution to the same problem (faster):
#include <cstdio>

int main()

{

    int n, deal;

    int four = 0, two = 0, odd = 0;

    scanf("%d", &n);

    while (n--)

    {

        scanf("%d", &deal);

        if (deal % 4 == 0)

            four++;

        else if (deal % 2 == 0)

            two++;

        else

            odd++;

    }

    if (two == 0)

    {

        if (four >= odd - 1)

            printf("Yes");

        else

            printf("No");

    }

    else if (four >= odd)

        printf("Yes");

    else

        printf("No");

}

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

#include<string>

#include<algorithm>

using namespace std;



int main()

{

	int n;

	cin>>n;

	int A=0,B=0,C=0,x;

	while(n--)

	{

		cin>>x;

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

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

		else C++;

	}

	if(A>=C)cout<<"Yes";

	else if(B==0&&C-A==1)cout<<"Yes";

	else cout<<"No";

	//system("pause");

}

// Optimized solution to the same problem (faster):
#include <cstdio>

int main()

{

    int n, deal;

    int four = 0, two = 0, odd = 0;

    scanf("%d", &n);

    while (n--)

    {

        scanf("%d", &deal);

        if (deal % 4 == 0)

            four++;

        else if (deal % 2 == 0)

            two++;

        else

            odd++;

    }

    if (two == 0)

    {

        if (four >= odd - 1)

            printf("Yes");

        else

            printf("No");

    }

    else if (four >= odd)

        printf("Yes");

    else

        printf("No");

}

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

#include <algorithm>

#include <cstdio>

#include <cstring>



using namespace std;



int ans[26];



int main(){

    int n;

    scanf("%d",&n);

    long long r1 = 0,r2 = 0;

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

        int k;

        scanf("%d",&k);

        if(k%4==0){

            r1++;

        }

        else if(k%2==0){

            r2++;

        }

    }

    if (n > r1*2+1+r2 ){

        printf("No");

    }

    else if (n == r1*2 + r2+1&&r2!=0){

        printf("No");

    }

    else{

        printf("Yes");

    }

}


// Optimized solution to the same problem (faster):
#include <cstdio>

int main()

{

    int n, deal;

    int four = 0, two = 0, odd = 0;

    scanf("%d", &n);

    while (n--)

    {

        scanf("%d", &deal);

        if (deal % 4 == 0)

            four++;

        else if (deal % 2 == 0)

            two++;

        else

            odd++;

    }

    if (two == 0)

    {

        if (four >= odd - 1)

            printf("Yes");

        else

            printf("No");

    }

    else if (four >= odd)

        printf("Yes");

    else

        printf("No");

}

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

using namespace std;



int main() {

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

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

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

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

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

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

		else c1++;

	}

	if(c4 >= c1) puts("Yes");

	else {

		if(c4 + 1 == c1 && !c2) puts("Yes");

		else puts("No");

	}

	return 0;

}


// Optimized solution to the same problem (faster):
#include <cstdio>

int main()

{

    int n, deal;

    int four = 0, two = 0, odd = 0;

    scanf("%d", &n);

    while (n--)

    {

        scanf("%d", &deal);

        if (deal % 4 == 0)

            four++;

        else if (deal % 2 == 0)

            two++;

        else

            odd++;

    }

    if (two == 0)

    {

        if (four >= odd - 1)

            printf("Yes");

        else

            printf("No");

    }

    else if (four >= odd)

        printf("Yes");

    else

        printf("No");

}

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

using namespace std;

const int N = 100010;

int a[N];

int main(){

	ios::sync_with_stdio(0);

	cin.tie(0), cout.tie(0);

	int n; cin >> n;

	int cnt2 = 0, cnt4 = 0, cnt1 = 0;

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

		cin >> a[i];

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

			cnt2++;

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

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

	}

	if(cnt4 == 0){

		if(cnt1 == 0)

			cout << "Yes\n";

		else

			cout << "No\n";

	}

	else{

		if(cnt2 > 0){

			if(cnt1 <= cnt4)

				cout << "Yes\n";

			else

				cout << "No\n";

		}

		else{

			if(cnt1 <= cnt4 + 1)

				cout << "Yes\n";

			else

				cout << "No\n";

		}

	}

	return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

int main()

{

    int n, deal;

    int four = 0, two = 0, odd = 0;

    scanf("%d", &n);

    while (n--)

    {

        scanf("%d", &deal);

        if (deal % 4 == 0)

            four++;

        else if (deal % 2 == 0)

            two++;

        else

            odd++;

    }

    if (two == 0)

    {

        if (four >= odd - 1)

            printf("Yes");

        else

            printf("No");

    }

    else if (four >= odd)

        printf("Yes");

    else

        printf("No");

}

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

using namespace std;

typedef long long ll;

int main()

{

	int n;

	scanf("%d",&n);

	ll temp;

	int num3=0;

	int num2=0;

	int num1=0;

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

	{

		scanf("%lld",&temp);

		if(temp%4==0)

		{

			num1++;

		}

		else if(temp%2==0)

		{

			num2++;

		}

		else

		{

			num3++;

		}

	}

	if(num2)

	{

		num2=1;

	}

	if(num1>=(num2+num3-1))

	{

		printf("Yes\n");

	}

	else

	{

		printf("No\n");

	}

	return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

int main()

{

    int n, deal;

    int four = 0, two = 0, odd = 0;

    scanf("%d", &n);

    while (n--)

    {

        scanf("%d", &deal);

        if (deal % 4 == 0)

            four++;

        else if (deal % 2 == 0)

            two++;

        else

            odd++;

    }

    if (two == 0)

    {

        if (four >= odd - 1)

            printf("Yes");

        else

            printf("No");

    }

    else if (four >= odd)

        printf("Yes");

    else

        printf("No");

}

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

#include<iostream>

#include<algorithm>

#include<cmath>

#include<string>



using namespace std;



int main(){

	int n,m[100001];

	cin>>n;

	int a=0,b=0;

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

		cin>>m[i];

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

		if(m[i]%4==0) b++;

	}

	if(a==n) cout<<"Yes";

	else if(b>=n/2) cout<<"Yes";

	else if(a+b>=n-b) cout<<"Yes";

	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++; //是4的倍数，可以放在任何数旁边构成幸运数列

        else if (x % 2 == 0)

            a2count++; //不是4但是2的倍数，要么放在a4旁边，要么放在a2 自己旁边

        else

            a1count++;//不是2的倍数，也不是4的倍数，就是其他数字，必须放在a4旁边

    }

    //先让a1与a4交替出现，a1的个数只能比a4的个数最多多一个，最好小于a4的个数

    if (a2count > 0 && a1count <= a4count) //类似 a1,a4,a1,a4,a2,a2,a2...

        printf("Yes\n");

    else if (a2count == 0 && a1count <= a4count + 1)//类似 a1,a4,a1 

        printf("Yes\n");

    else

        printf("No\n");



    return 0;

}

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

#include<iostream>

#include<cmath>

#include<queue>

#include<algorithm>

#include<cstring>

#include<string>

#include<vector>

#define MAXN 5003

using namespace std;









int main(){

    vector<int> a1;

    vector<int> a2;

    vector<int> a4;

    bool flag=1;

    int n;

    cin >> n;

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

        int a;

        cin >> a;

        if(a%4 == 0)

            a4.push_back(a);

        else if(a%2 == 0)

            a2.push_back(a);

        else

            a1.push_back(a);

    }



    if(a4.size() + 1 < a1.size()){

        flag = 0;

    }else if(a4.size() < a1.size()){

        if(a2.size() > 0)

            flag = 0;

    }

    if(flag) 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++; //是4的倍数，可以放在任何数旁边构成幸运数列

        else if (x % 2 == 0)

            a2count++; //不是4但是2的倍数，要么放在a4旁边，要么放在a2 自己旁边

        else

            a1count++;//不是2的倍数，也不是4的倍数，就是其他数字，必须放在a4旁边

    }

    //先让a1与a4交替出现，a1的个数只能比a4的个数最多多一个，最好小于a4的个数

    if (a2count > 0 && a1count <= a4count) //类似 a1,a4,a1,a4,a2,a2,a2...

        printf("Yes\n");

    else if (a2count == 0 && a1count <= a4count + 1)//类似 a1,a4,a1 

        printf("Yes\n");

    else

        printf("No\n");



    return 0;

}

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

#include<algorithm>

using namespace std;

int main() {

	int n;

	cin>>n;

	int x,y,z;

	x=y=z=0;

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

	{

		int m;

		cin>>m;

		if(m%4==0)

		x++;

		else if(m%2==0)

		y++;

		else

		z++;

	}

	if(z<=x||(z==x+1&&y==0))

	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++; //是4的倍数，可以放在任何数旁边构成幸运数列

        else if (x % 2 == 0)

            a2count++; //不是4但是2的倍数，要么放在a4旁边，要么放在a2 自己旁边

        else

            a1count++;//不是2的倍数，也不是4的倍数，就是其他数字，必须放在a4旁边

    }

    //先让a1与a4交替出现，a1的个数只能比a4的个数最多多一个，最好小于a4的个数

    if (a2count > 0 && a1count <= a4count) //类似 a1,a4,a1,a4,a2,a2,a2...

        printf("Yes\n");

    else if (a2count == 0 && a1count <= a4count + 1)//类似 a1,a4,a1 

        printf("Yes\n");

    else

        printf("No\n");



    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
/*

        Author: Prokash

                CSE48, JU



*/



#include<bits/stdc++.h>

using namespace std;



typedef long long ll;

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

int main()

{

    FAST;

    ll n,t,i,d,d2;

    cin>>t;

    d=0;

    d2=0;

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

    {

        cin>>n;

        if(n%4==0)

        {

            d++;

        }

        if(n%4==2)

        {

            d2++;

        }

    }

    ll s=t/2;

    if(d>=s)

    {

        cout<<"Yes"<<endl;

    }

    else if((d2/2+d)>=s)

    {

        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++; //是4的倍数，可以放在任何数旁边构成幸运数列

        else if (x % 2 == 0)

            a2count++; //不是4但是2的倍数，要么放在a4旁边，要么放在a2 自己旁边

        else

            a1count++;//不是2的倍数，也不是4的倍数，就是其他数字，必须放在a4旁边

    }

    //先让a1与a4交替出现，a1的个数只能比a4的个数最多多一个，最好小于a4的个数

    if (a2count > 0 && a1count <= a4count) //类似 a1,a4,a1,a4,a2,a2,a2...

        printf("Yes\n");

    else if (a2count == 0 && a1count <= a4count + 1)//类似 a1,a4,a1 

        printf("Yes\n");

    else

        printf("No\n");



    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
////////////////////////// Author

////////////////////////// Nasim Hossain Rabbi

////////////////////////// JU-CSE28

////////////////////////// CF - imnasim3.1415

////////////////////////// UVA - imnasim3.1415

////////////////////////// Mail - imnasim3.1415@gmail.com



#include<bits/stdc++.h>

using namespace std;

#define sz size()

#define mk make_pair

#define clr clear()

#define B begin()

#define E end()

#define EM empty()

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

#define rep(i,n) for(i=0;i<n;i++)

#define Rep(i,n) for(i=1;i<=n;i++)

#define all(cont) cont.begin(),cont.end()

#define pb push_back

#define endl '\n'

#define fast ios_base::sync_with_stdio(false); cin.tie(NULL)

#define pi 3.1415926535897932384626433832795

#define vi vector<int>

#define vs vector<string>

#define vp(vi,x) cin>>x; vi.pb(x);

typedef long long int LL;

typedef unsigned long long int ULL;

int main()

{

//    fast;

    int i,j,k,n,m,l,s=0,x,y,tc=1;

    while(cin>>n)

    {

        vi a;

        int f=0,t=0,tn=0,o=0, c=0;

        rep(i,n)

        {

            cin>>x;

            a.pb(x);

            c++;

            if(x%4==0)

                f++;

            else if(x%2==0)

                t++;

        }

        if(f>=(n/2)) cout<<"Yes"<<endl;

        else if((t/2)+f>=(n/2)) cout<<"Yes"<<endl;

        else cout<<"No"<<endl;

    }

}




// 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++; //是4的倍数，可以放在任何数旁边构成幸运数列

        else if (x % 2 == 0)

            a2count++; //不是4但是2的倍数，要么放在a4旁边，要么放在a2 自己旁边

        else

            a1count++;//不是2的倍数，也不是4的倍数，就是其他数字，必须放在a4旁边

    }

    //先让a1与a4交替出现，a1的个数只能比a4的个数最多多一个，最好小于a4的个数

    if (a2count > 0 && a1count <= a4count) //类似 a1,a4,a1,a4,a2,a2,a2...

        printf("Yes\n");

    else if (a2count == 0 && a1count <= a4count + 1)//类似 a1,a4,a1 

        printf("Yes\n");

    else

        printf("No\n");



    return 0;

}

// Fastest known solution for this problem: