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

using namespace std;



#define vi push_back

#define vo pop_back

#define mp make_pair

#define fe first

#define se second

typedef long long ll;



int n;

vector <int> a, Foura;



void Solve () {

	int tmp, FourCount = 0, TwoCount = 0;

	cin >> n;

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

		cin >> tmp;

		if (tmp % 4 == 0) {

			FourCount++;

		}

		else if (tmp % 2 == 0) {

			TwoCount++;

		}

	}

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

		cout << "No\n";

		exit (0);

	}

	else {

		cout << "Yes\n";

		exit(0);

	}

}



int main () {

	Solve();

	return 0;

}




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

#include <stdlib.h>

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

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

	int nn=n;

	int x;

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

	while(nn--)

	{

		scanf("%d",&x);

		if(x%4==0)

			n4++;

		else if(x%2==0)

			n2++;

		else

			n1++;

	} 

	if(n2)

	{

		if(n4>=n1)

			printf("Yes\n");

		else

			printf("No\n");

	}

	else

	{

		if(n4+1>=n1)

			printf("Yes\n");

		else

			printf("No\n");

	}

	return 0;

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

using namespace std;

int main()

{

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

	cin>>n;

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

		int t;

		cin>>t;

		if(t%4==0)

			a4++;

		else if(t%2==0)

			a2++;

		else a1++;

	}

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

		cout<<"Yes"<<endl;

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

	cout<<"Yes"<<endl;

		else cout<<"No"<<endl;

	return 0;

}

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

#include <stdlib.h>

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

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

	int nn=n;

	int x;

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

	while(nn--)

	{

		scanf("%d",&x);

		if(x%4==0)

			n4++;

		else if(x%2==0)

			n2++;

		else

			n1++;

	} 

	if(n2)

	{

		if(n4>=n1)

			printf("Yes\n");

		else

			printf("No\n");

	}

	else

	{

		if(n4+1>=n1)

			printf("Yes\n");

		else

			printf("No\n");

	}

	return 0;

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

using namespace std;



#define LL long long

#define LD long double

#define Mod 1000000007

#define L_Mod 17100000013



const double eps = 1e-9;

const int INF = 0x3f3f3f3f;

const double PI = 3.1415926535;



#define NO_TLE std::ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);



#define ree(a,n) memset(a,n,si 2)



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

#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))

#define red(i,l,u) for(int (i)=(int)(l);(i)>=(int)(u);--(i))





int main()

{

    LL n,m,M4=0,M2=0;

    cin>>n;

    LL  a[100002]= {0};

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

        cin>>a[i];

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

    {

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

            M4++;

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

            M2++;

    }

    M2=M2/2*2;

    if(M4*2+1+M2>=n)

        cout<<"Yes";

    else

        cout<<"No";

}


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

using namespace std;

int main(){

	int N;

	int num[100000]={0};

	cin>>N;

	int jishu=0,oushu=0,numfour=0;

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

		cin>>num[i];

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

			numfour++;

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

			oushu++;

		}else{

			jishu++;

		}

	}

	if(oushu){

		jishu++;

	}

	if(jishu-1>numfour){

		cout<<"No"<<endl;

	}else{

		cout<<"Yes"<<endl;

	}

	return 0;

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

using namespace std;



#define LL long long

#define LD long double

#define Mod 1000000007

#define L_Mod 17100000013



const double eps = 1e-9;

const int INF = 0x3f3f3f3f;

const double PI = 3.1415926535;



#define NO_TLE std::ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);



#define ree(a,n) memset(a,n,si 2)



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

#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))

#define red(i,l,u) for(int (i)=(int)(l);(i)>=(int)(u);--(i))





int main()

{

    LL n,m,M4=0,M2=0;

    cin>>n;

    LL  a[100002]= {0};

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

        cin>>a[i];

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

    {

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

            M4++;

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

            M2++;

    }

    M2=M2/2*2;

    if(M4*2+1+M2>=n)

        cout<<"Yes";

    else

        cout<<"No";

}


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

#include <algorithm>

#include <cmath>

#include <deque>

#include <vector>

#include <queue>

#include <string>

#include <cstring>

#include <map>

#include <stack>

#include <set>

using namespace std;

int main(){

	int n,i,flag=0,flag2=0;

	cin>>n;

	long long a[n];

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

		cin>>a[i];

	}

	sort(a,a+n);

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

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

			flag++;

		}

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

			flag2++;

		}

	}

	flag2/=2;

	int s=2*(flag+flag2)+1;

	if(n>s){

		cout<<"No"<<endl;

	}else{

		cout<<"Yes"<<endl;

	}

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

using namespace std;

int main(){

	int N;

	int num[100000]={0};

	cin>>N;

	int jishu=0,oushu=0,numfour=0;

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

		cin>>num[i];

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

			numfour++;

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

			oushu++;

		}else{

			jishu++;

		}

	}

	if(oushu){

		jishu++;

	}

	if(jishu-1>numfour){

		cout<<"No"<<endl;

	}else{

		cout<<"Yes"<<endl;

	}

	return 0;

}

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

#include <algorithm>

#include <cmath>

#include <deque>

#include <vector>

#include <queue>

#include <string>

#include <cstring>

#include <map>

#include <stack>

#include <set>

using namespace std;

int main(){

	int n,i,flag=0,flag2=0;

	cin>>n;

	long long a[n];

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

		cin>>a[i];

	}

	sort(a,a+n);

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

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

			flag++;

		}

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

			flag2++;

		}

	}

	flag2/=2;

	int s=2*(flag+flag2)+1;

	if(n>s){

		cout<<"No"<<endl;

	}else{

		cout<<"Yes"<<endl;

	}

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

using namespace std;



#define LL long long

#define LD long double

#define Mod 1000000007

#define L_Mod 17100000013



const double eps = 1e-9;

const int INF = 0x3f3f3f3f;

const double PI = 3.1415926535;



#define NO_TLE std::ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);



#define ree(a,n) memset(a,n,si 2)



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

#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))

#define red(i,l,u) for(int (i)=(int)(l);(i)>=(int)(u);--(i))





int main()

{

    LL n,m,M4=0,M2=0;

    cin>>n;

    LL  a[100002]= {0};

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

        cin>>a[i];

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

    {

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

            M4++;

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

            M2++;

    }

    M2=M2/2*2;

    if(M4*2+1+M2>=n)

        cout<<"Yes";

    else

        cout<<"No";

}


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

#include<stdio.h>

#include<cstring>

#include<cmath>

#include<algorithm>

#include<map>

#define ll long long

using namespace std;

int a[200009];

int main(){

    int n;

    cin>>n;

    int two=0;

    int fou=0;

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

        cin>>a[i];

 

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

            fou++;

        }

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

            two++;

        }

    }

    n-=(two/2)*2;

    n-=fou;

    if(fou>=n-1){

        cout<<"Yes"<<endl;

    }

    else{

        cout<<"No"<<endl;

    }

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

using namespace std;

int main(){

	int N;

	int num[100000]={0};

	cin>>N;

	int jishu=0,oushu=0,numfour=0;

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

		cin>>num[i];

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

			numfour++;

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

			oushu++;

		}else{

			jishu++;

		}

	}

	if(oushu){

		jishu++;

	}

	if(jishu-1>numfour){

		cout<<"No"<<endl;

	}else{

		cout<<"Yes"<<endl;

	}

	return 0;

}

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

#include<stdio.h>

#include<cstring>

#include<cmath>

#include<algorithm>

#include<map>

#define ll long long

using namespace std;

int a[200009];

int main(){

    int n;

    cin>>n;

    int two=0;

    int fou=0;

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

        cin>>a[i];

 

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

            fou++;

        }

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

            two++;

        }

    }

    n-=(two/2)*2;

    n-=fou;

    if(fou>=n-1){

        cout<<"Yes"<<endl;

    }

    else{

        cout<<"No"<<endl;

    }

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

int main(){

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

scanf("%d",&n);

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

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

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

}

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

else printf("No");

return 0;

}




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

#include<cstring>

#include<algorithm>

#include<cmath>



using namespace std;

int cnt4,cnt2,n;

int a;



int main()

{

    scanf("%d",&n);

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

    {

        scanf("%d",&a);

        if(a%4==0)

            cnt4++;

            else if(a%2==0)

                cnt2++;

    }

    if(cnt2+cnt4*2<n-1)

        printf("No\n");

        else if(cnt4*2+cnt2==n-1&&cnt2!=0)

            printf("No\n");

            else

                printf("Yes\n");

    return 0;

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

using namespace std;

int main(){

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

	cin>>a;

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

		cin>>b;

		cnt=0;

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

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

		if(cnt==1)x++;

		if(cnt==2)y++;

	}

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

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

	else cout<<"No";

}

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

#include<cstring>

#include<algorithm>

#include<cmath>



using namespace std;

int cnt4,cnt2,n;

int a;



int main()

{

    scanf("%d",&n);

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

    {

        scanf("%d",&a);

        if(a%4==0)

            cnt4++;

            else if(a%2==0)

                cnt2++;

    }

    if(cnt2+cnt4*2<n-1)

        printf("No\n");

        else if(cnt4*2+cnt2==n-1&&cnt2!=0)

            printf("No\n");

            else

                printf("Yes\n");

    return 0;

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

#include<algorithm>

using namespace std;

int main()

{

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

    int n;

    cin>>n;

    while(n--){

    	int tmp;

    	cin>>tmp;

    	if(tmp%4==0)

    		a++;

		else if(tmp%2==0)

			b++;

		else

			c++;

	}

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

		if(b==1)

			cout<<"No"<<endl;

		else	

			cout<<"Yes"<<endl;

		return 0;

	}

	if(b!=0)

		c++;

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

		cout<<"No"<<endl;

	else if(c<=a+1)

		cout<<"Yes"<<endl;

	else

		cout<<"No"<<endl;

    return 0;

}

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

#include<cstring>

#include<algorithm>

#include<cmath>



using namespace std;

int cnt4,cnt2,n;

int a;



int main()

{

    scanf("%d",&n);

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

    {

        scanf("%d",&a);

        if(a%4==0)

            cnt4++;

            else if(a%2==0)

                cnt2++;

    }

    if(cnt2+cnt4*2<n-1)

        printf("No\n");

        else if(cnt4*2+cnt2==n-1&&cnt2!=0)

            printf("No\n");

            else

                printf("Yes\n");

    return 0;

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



using namespace std;



#define fir first

#define sec second

#define ins insert

#define pb push_back

#define po pop_back

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

#define PI 3.14159265

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

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



typedef long long ll;



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

ll n , four , m_two , tmp , num;



void read_input(){

        cin >> n;

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

                cin >> num;

                

                if(num % 4 == 2)

                        m_two++;

                

                else if(num % 4 == 0)

                        four++;

        }

}



void solve(){

        tmp = n - m_two - four;



        if(m_two){

                if(four >= tmp)

                        YES

                else

                        NO

        }



        else{

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

                        YES

                else

                        NO

        }

}



void output(){

        //no output

}



int main(){

        IOS;

        read_input();

        solve();

        output();

        return 0;

}

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

#include<cstring>

#include<algorithm>

#include<cmath>



using namespace std;

int cnt4,cnt2,n;

int a;



int main()

{

    scanf("%d",&n);

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

    {

        scanf("%d",&a);

        if(a%4==0)

            cnt4++;

            else if(a%2==0)

                cnt2++;

    }

    if(cnt2+cnt4*2<n-1)

        printf("No\n");

        else if(cnt4*2+cnt2==n-1&&cnt2!=0)

            printf("No\n");

            else

                printf("Yes\n");

    return 0;

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

using namespace std;



#define vi push_back

#define vo pop_back

#define mp make_pair

#define fe first

#define se second

typedef long long ll;



int n;

vector <int> a, Foura;



void Solve () {

	int tmp, FourCount = 0, TwoCount = 0;

	cin >> n;

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

		cin >> tmp;

		if (tmp % 4 == 0) {

			FourCount++;

		}

		else if (tmp % 2 == 0) {

			TwoCount++;

		}

	}

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

		cout << "No\n";

		exit (0);

	}

	else {

		cout << "Yes\n";

		exit(0);

	}

}



int main () {

	Solve();

	return 0;

}




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

#include<cstring>

#include<algorithm>

#include<cmath>



using namespace std;

int cnt4,cnt2,n;

int a;



int main()

{

    scanf("%d",&n);

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

    {

        scanf("%d",&a);

        if(a%4==0)

            cnt4++;

            else if(a%2==0)

                cnt2++;

    }

    if(cnt2+cnt4*2<n-1)

        printf("No\n");

        else if(cnt4*2+cnt2==n-1&&cnt2!=0)

            printf("No\n");

            else

                printf("Yes\n");

    return 0;

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

using namespace std;

int main()

{

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

	cin>>n;

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

		int t;

		cin>>t;

		if(t%4==0)

			a4++;

		else if(t%2==0)

			a2++;

		else a1++;

	}

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

		cout<<"Yes"<<endl;

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

	cout<<"Yes"<<endl;

		else cout<<"No"<<endl;

	return 0;

}

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

#include<cstring>

#include<algorithm>

#include<cmath>



using namespace std;

int cnt4,cnt2,n;

int a;



int main()

{

    scanf("%d",&n);

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

    {

        scanf("%d",&a);

        if(a%4==0)

            cnt4++;

            else if(a%2==0)

                cnt2++;

    }

    if(cnt2+cnt4*2<n-1)

        printf("No\n");

        else if(cnt4*2+cnt2==n-1&&cnt2!=0)

            printf("No\n");

            else

                printf("Yes\n");

    return 0;

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

#include <algorithm>

#include <map>

using namespace std;

typedef long long ll;



int main(){

    int n, ji = 0, b4 = 0;

    cin >> n;

    ll t;

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

        cin >> t;

        if (t & 1) ji++;

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

    }

    if ((!(n & 1) && b4 >= ji) || ((n & 1) && b4 + 1 >= ji)) cout << "Yes" << endl;

    else cout << "No" << endl; 

    return 0;

}

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

#include<cstring>

#include<algorithm>

#include<cmath>



using namespace std;

int cnt4,cnt2,n;

int a;



int main()

{

    scanf("%d",&n);

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

    {

        scanf("%d",&a);

        if(a%4==0)

            cnt4++;

            else if(a%2==0)

                cnt2++;

    }

    if(cnt2+cnt4*2<n-1)

        printf("No\n");

        else if(cnt4*2+cnt2==n-1&&cnt2!=0)

            printf("No\n");

            else

                printf("Yes\n");

    return 0;

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

using namespace std;



#define LL long long

#define LD long double

#define Mod 1000000007

#define L_Mod 17100000013



const double eps = 1e-9;

const int INF = 0x3f3f3f3f;

const double PI = 3.1415926535;



#define NO_TLE std::ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);



#define ree(a,n) memset(a,n,si 2)



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

#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))

#define red(i,l,u) for(int (i)=(int)(l);(i)>=(int)(u);--(i))





int main()

{

    LL n,m,M4=0,M2=0;

    cin>>n;

    LL  a[100002]= {0};

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

        cin>>a[i];

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

    {

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

            M4++;

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

            M2++;

    }

    M2=M2/2*2;

    if(M4*2+1+M2>=n)

        cout<<"Yes";

    else

        cout<<"No";

}


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

#include<cstring>

#include<algorithm>

#include<cmath>



using namespace std;

int cnt4,cnt2,n;

int a;



int main()

{

    scanf("%d",&n);

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

    {

        scanf("%d",&a);

        if(a%4==0)

            cnt4++;

            else if(a%2==0)

                cnt2++;

    }

    if(cnt2+cnt4*2<n-1)

        printf("No\n");

        else if(cnt4*2+cnt2==n-1&&cnt2!=0)

            printf("No\n");

            else

                printf("Yes\n");

    return 0;

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

using namespace std;

int main(){

	int N;

	int num[100000]={0};

	cin>>N;

	int jishu=0,oushu=0,numfour=0;

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

		cin>>num[i];

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

			numfour++;

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

			oushu++;

		}else{

			jishu++;

		}

	}

	if(oushu){

		jishu++;

	}

	if(jishu-1>numfour){

		cout<<"No"<<endl;

	}else{

		cout<<"Yes"<<endl;

	}

	return 0;

}

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

#include<cstring>

#include<algorithm>

#include<cmath>



using namespace std;

int cnt4,cnt2,n;

int a;



int main()

{

    scanf("%d",&n);

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

    {

        scanf("%d",&a);

        if(a%4==0)

            cnt4++;

            else if(a%2==0)

                cnt2++;

    }

    if(cnt2+cnt4*2<n-1)

        printf("No\n");

        else if(cnt4*2+cnt2==n-1&&cnt2!=0)

            printf("No\n");

            else

                printf("Yes\n");

    return 0;

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

#include <algorithm>

#include <cmath>

#include <deque>

#include <vector>

#include <queue>

#include <string>

#include <cstring>

#include <map>

#include <stack>

#include <set>

using namespace std;

int main(){

	int n,i,flag=0,flag2=0;

	cin>>n;

	long long a[n];

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

		cin>>a[i];

	}

	sort(a,a+n);

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

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

			flag++;

		}

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

			flag2++;

		}

	}

	flag2/=2;

	int s=2*(flag+flag2)+1;

	if(n>s){

		cout<<"No"<<endl;

	}else{

		cout<<"Yes"<<endl;

	}

}

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

#include<cstring>

#include<algorithm>

#include<cmath>



using namespace std;

int cnt4,cnt2,n;

int a;



int main()

{

    scanf("%d",&n);

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

    {

        scanf("%d",&a);

        if(a%4==0)

            cnt4++;

            else if(a%2==0)

                cnt2++;

    }

    if(cnt2+cnt4*2<n-1)

        printf("No\n");

        else if(cnt4*2+cnt2==n-1&&cnt2!=0)

            printf("No\n");

            else

                printf("Yes\n");

    return 0;

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

#include<stdio.h>

#include<cstring>

#include<cmath>

#include<algorithm>

#include<map>

#define ll long long

using namespace std;

int a[200009];

int main(){

    int n;

    cin>>n;

    int two=0;

    int fou=0;

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

        cin>>a[i];

 

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

            fou++;

        }

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

            two++;

        }

    }

    n-=(two/2)*2;

    n-=fou;

    if(fou>=n-1){

        cout<<"Yes"<<endl;

    }

    else{

        cout<<"No"<<endl;

    }

}

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

#include<cstring>

#include<algorithm>

#include<cmath>



using namespace std;

int cnt4,cnt2,n;

int a;



int main()

{

    scanf("%d",&n);

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

    {

        scanf("%d",&a);

        if(a%4==0)

            cnt4++;

            else if(a%2==0)

                cnt2++;

    }

    if(cnt2+cnt4*2<n-1)

        printf("No\n");

        else if(cnt4*2+cnt2==n-1&&cnt2!=0)

            printf("No\n");

            else

                printf("Yes\n");

    return 0;

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

int main(){

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

scanf("%d",&n);

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

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

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

}

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

else printf("No");

return 0;

}




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

const int maxn = 100005;



int main(){

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

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

	scanf("%d", &n);

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

		scanf("%d", &x);

		if(x%4==0){

			c++;

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

			b++;

		}else{

			a++;

		}

	}

	if(b==0){

		if(a-1>c){

			printf("No\n");

		}else{

			printf("Yes\n");

		}

	}else{

		if(a>c){

			printf("No\n");

		}else{

			printf("Yes\n");

		}

	}



	return 0;

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

using namespace std;

int main(){

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

	cin>>a;

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

		cin>>b;

		cnt=0;

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

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

		if(cnt==1)x++;

		if(cnt==2)y++;

	}

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

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

	else cout<<"No";

}

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

const int maxn = 100005;



int main(){

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

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

	scanf("%d", &n);

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

		scanf("%d", &x);

		if(x%4==0){

			c++;

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

			b++;

		}else{

			a++;

		}

	}

	if(b==0){

		if(a-1>c){

			printf("No\n");

		}else{

			printf("Yes\n");

		}

	}else{

		if(a>c){

			printf("No\n");

		}else{

			printf("Yes\n");

		}

	}



	return 0;

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

#include<algorithm>

using namespace std;

int main()

{

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

    int n;

    cin>>n;

    while(n--){

    	int tmp;

    	cin>>tmp;

    	if(tmp%4==0)

    		a++;

		else if(tmp%2==0)

			b++;

		else

			c++;

	}

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

		if(b==1)

			cout<<"No"<<endl;

		else	

			cout<<"Yes"<<endl;

		return 0;

	}

	if(b!=0)

		c++;

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

		cout<<"No"<<endl;

	else if(c<=a+1)

		cout<<"Yes"<<endl;

	else

		cout<<"No"<<endl;

    return 0;

}

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

const int maxn = 100005;



int main(){

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

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

	scanf("%d", &n);

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

		scanf("%d", &x);

		if(x%4==0){

			c++;

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

			b++;

		}else{

			a++;

		}

	}

	if(b==0){

		if(a-1>c){

			printf("No\n");

		}else{

			printf("Yes\n");

		}

	}else{

		if(a>c){

			printf("No\n");

		}else{

			printf("Yes\n");

		}

	}



	return 0;

}