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

#include <stdlib.h>

#include <iostream>

#include <algorithm>

#include <cmath>

#include <cstring>

#include <map>

#include <vector>



using namespace std;



int A[110000];

int cnt1=0;

int cnt2=0;



int main()

{

    int n;

    scanf("%d",&n);

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

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

    

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

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

            cnt1++;

        }

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

            cnt2++;

    }

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

        printf("Yes\n");

    }else{

        printf("No\n");

    }



    return 0;

}




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

#include<cstring>

//long long

const int len = 1e5 + 5;

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



int main(void)

{

	scanf("%d", &N);

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

	{

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

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

			++cnt[4];

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

			++cnt[2];

		else

			++ cnt[1];

	}

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

		printf("Yes");

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

		printf("Yes");

	else

		printf("No");

	return 0;

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



using namespace std;



#define pb push_back

#define ff first

#define ss second



typedef long long ll;

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



struct pair_hash {

	template <class T1, class T2>

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

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

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



		return h1 ^ h2;  

	}

};



ll pw(ll te, ll tee) {

	if (tee == 0)	return 1;

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

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

}



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



void Read_input() {

	cin >> n;

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

}



void Solve() {

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

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

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

		else	p++;

	}

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

	else	cout << "No";

}





int main() {



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

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



	Read_input(),	Solve();

	return 0;

}

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

#include<cstring>

//long long

const int len = 1e5 + 5;

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



int main(void)

{

	scanf("%d", &N);

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

	{

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

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

			++cnt[4];

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

			++cnt[2];

		else

			++ cnt[1];

	}

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

		printf("Yes");

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

		printf("Yes");

	else

		printf("No");

	return 0;

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

#include <bits/stdc++.h>

using namespace std;

typedef long long ll ;

int a[100010] ;

int main() 

{

	ios::sync_with_stdio(false) ;

	cin.tie(0) ;

	cout.tie(0) ;

	int n ;

	cin >> n ;

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

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

	{

		cin >> a[i] ;

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

		{

			cnt_4++ ;

		}

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

		{

			cnt_2++ ;

		}

		else

		{

			cnt_1++ ;

		}

	}

	if(cnt_1>cnt_4+1)

	{

		cout << "No" ;

		return 0 ;

	}

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

	{

		cout << "No" ;

		return 0 ;

	}

	cout << "Yes" ;

	return 0 ;

}


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

#include<cstring>

//long long

const int len = 1e5 + 5;

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



int main(void)

{

	scanf("%d", &N);

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

	{

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

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

			++cnt[4];

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

			++cnt[2];

		else

			++ cnt[1];

	}

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

		printf("Yes");

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

		printf("Yes");

	else

		printf("No");

	return 0;

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



using namespace std;



int main()

{

	int n;

	cin >> n;

	int a = 0, b = 0;

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

	{

		int x;

		cin >> x;

		if(x % 4 == 2)

		{

			a ++;

		}

		if(x % 4 == 0)

		{

			b ++;

		}

	}

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

	{

		cout << "Yes";

	}

	else

	{

		cout << "No";

	}

	return 0;

}

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

#include<cstring>

//long long

const int len = 1e5 + 5;

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



int main(void)

{

	scanf("%d", &N);

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

	{

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

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

			++cnt[4];

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

			++cnt[2];

		else

			++ cnt[1];

	}

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

		printf("Yes");

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

		printf("Yes");

	else

		printf("No");

	return 0;

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

#include <vector>

#include <queue>

#include <string>

#include <set>

#include <math.h>

#include<algorithm>

using namespace std;







int main()

{

 int n;

 cin>>n;

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

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

 {

     int tmp;

     cin>>tmp;

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

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

     else c++;





 }

 if(n==2)

    {

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

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

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

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



    }





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

else{

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

    else {

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

        else 

            {

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

                else cout<<"No"<<endl;

            }

    }



}



  return 0;

}

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

#include<cstring>

//long long

const int len = 1e5 + 5;

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



int main(void)

{

	scanf("%d", &N);

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

	{

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

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

			++cnt[4];

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

			++cnt[2];

		else

			++ cnt[1];

	}

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

		printf("Yes");

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

		printf("Yes");

	else

		printf("No");

	return 0;

}
// Slower C++ solution:
#include "iostream"

#include "map"

#include "vector"



using namespace std;

int main()

{

	int n;

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

	cin>>n;

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

	{

		int num;

		cin>>num;

		if(num%4==0)

			a4++;

		else if(num%2==0)

			a2++;

		else

			a1++;

	}

	if((a4+1==a1&&a2==0)||(a4>=a1))

		cout<<"Yes"<<endl;

	else

		cout<<"No"<<endl;	

	system("pause");

}


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

#include<cstring>

//long long

const int len = 1e5 + 5;

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



int main(void)

{

	scanf("%d", &N);

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

	{

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

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

			++cnt[4];

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

			++cnt[2];

		else

			++ cnt[1];

	}

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

		printf("Yes");

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

		printf("Yes");

	else

		printf("No");

	return 0;

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

#include <string>

using namespace std;



int main ()

{

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

	cin >> n;

	int num[n];

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

	{

		cin >> d;

		num[i] = d % 4;

	}

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

	{

		switch(num[i])

		{

			case 0: ++ a; break;

			case 1: ++ b; break;

			case 2: ++ c; break;

			case 3: ++ b; break;

		}

	}

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

	else 

	{

		if (a == 0) cout << "No" << endl;

		else 

		{

			if (c == 0 && a >= b - 1) cout << "Yes" << endl;

			else if (c != 0 && a >= b) cout << "Yes" << endl;

			else cout << "No" << endl;

		}

	} 

	return 0;

} 

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

#include<cstring>

//long long

const int len = 1e5 + 5;

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



int main(void)

{

	scanf("%d", &N);

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

	{

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

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

			++cnt[4];

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

			++cnt[2];

		else

			++ cnt[1];

	}

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

		printf("Yes");

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

		printf("Yes");

	else

		printf("No");

	return 0;

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

#include <cstdio>



using namespace std;



int main(){

    int n;

    scanf("%d",&n);

    int a = 0;

    int b = 0;

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

        int k;

        scanf("%d",&k);

        if (k%4==0){

            a++;

        }

        else if (k%2 == 0){

            b++;

        }

    }

    if (n > 1+a*2+b){

        printf("No\n");

    }

    else if (n == 1+a*2+b&&b!=0){

        printf("No\n");

    }

    else {

        printf("Yes\n");

    }

    return 0;

}


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

#include<cstring>

//long long

const int len = 1e5 + 5;

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



int main(void)

{

	scanf("%d", &N);

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

	{

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

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

			++cnt[4];

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

			++cnt[2];

		else

			++ cnt[1];

	}

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

		printf("Yes");

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

		printf("Yes");

	else

		printf("No");

	return 0;

}
// Slower C++ solution:
/*zxj*/

#include<iostream> 

#include<string>

#include<cstring>

#include<algorithm>

#include<cstdio>

#include<cmath>

#include<set>

#include<map>

#include<vector>

#include<queue>

#include<sstream>

#define sf scanf

#define pf printf

#define pfn printf("\n");

#define pfk printf(" ");

#define pf0 printf("0");

#define pf1 printf("1");

#define ll long long

#define sfd(n) scanf("%d",&n);

#define sfdd(n,m) scanf("%d%d",&n,&m);

#define sfld(n) scanf("%lld",&n);

#define sfldd(n,m) scanf("%lld%lld",&n,&m);

#define sflf(n) scanf("%lf",&n);

#define sflff(n,m) scanf("%lf%lf",&n,&m);

#define sfc(n) scanf("%c",n);

#define sfcc(n,m) scanf("%c%c",n,m);

#define sfs(n) scanf("%s",n);

#define sfss(n,m) scanf("%s%s",n,m);

#define pfd(n) printf("%d",n);

#define pfld(n) printf("%lld",n);

#define pflf(n) printf("%lf",n);

#define pfc(n) printf("%c",n);

#define pfs(n) printf("%s",n);

using namespace std;

#define csh(a,n) memset(a,n,sizeof(a));

int main(){

	int n;

	cin>>n;

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

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

		int d;

		cin>>d;

		if(d%2==0){

			if(d%4==0){

				c++;

			}

			else{

				b++;

			}

		}

		else{

			a++;

		}

	}

	if(b!=0){

		a++;

	}

	if(a-1<=c){

		cout<<"Yes"<<endl;

	}

	else{

		cout<<"No"<<endl;

	}

}

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

#include<cstring>

//long long

const int len = 1e5 + 5;

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



int main(void)

{

	scanf("%d", &N);

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

	{

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

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

			++cnt[4];

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

			++cnt[2];

		else

			++ cnt[1];

	}

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

		printf("Yes");

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

		printf("Yes");

	else

		printf("No");

	return 0;

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

#include<cstdio>

#include<cmath>

using namespace std;

int main() {

	int n;

	long long int a[105000];

	scanf("%d",&n);

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

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

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

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

			cnt++;

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

			cnt2++;

		}else{

			cnt1++;

		}

	}

	if(cnt>=cnt1){

		printf("Yes");

	}else{

		if(cnt==cnt1-1&&cnt2==0){

			printf("Yes");

		}else{

			printf("No");

		}

	}

	return 0;

}

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

#include<cstring>

//long long

const int len = 1e5 + 5;

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



int main(void)

{

	scanf("%d", &N);

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

	{

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

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

			++cnt[4];

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

			++cnt[2];

		else

			++ cnt[1];

	}

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

		printf("Yes");

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

		printf("Yes");

	else

		printf("No");

	return 0;

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

#include <cstring>

#include <algorithm>

#include <vector>

#include <math.h>

#include <string.h>

#include <algorithm>

#include <iostream>

#include <string>

#include <sstream>

#include <iostream>

#include <time.h>

#include <queue>

#include <list>

#include <map>

#include <set>

#include <vector>

#include <stack>

#include <string.h>

#define sf scanf

#define pf printf

#define lf double

#define ll long long

#define p123 printf("123\n");

#define pn printf("\n");

#define pk printf(" ");

#define p(n) printf("%d",n);

#define pln(n) printf("%d\n",n);

#define s(n) scanf("%d",&n);

#define ss(n) scanf("%s",n);

#define ps(n) printf("%s",n);

#define sld(n) scanf("%lld",&n);

#define pld(n) printf("%lld",n);

#define slf(n) scanf("%lf",&n);

#define plf(n) printf("%lf",n);

#define sc(n) scanf("%c",&n);

#define pc(n) printf("%c",n);

#define gc getchar();

#define re(n,a) memset(n,a,sizeof(n));

#define len(a) strlen(a)

using namespace std;

//https://codeforces.com/contest/1228/problems

//https://codeforces.com/contest/1228/submit

int main() {

    int n;

    s(n)

    int count0 = 0;

    int count1 = 0;

    int x;



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

        s(x)

        if(x % 4 == 0) {

            count0 ++;

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

            count1 ++;

        }

    }

    if(n <= count0*2+1){

        puts("Yes");

    }else{

        n-= count0*2;

        if(n <= count1){

            puts("Yes");

        }else{

            puts("No");

        }

        

        

        

    }

    

    

    return 0;

}


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

#include<cstring>

//long long

const int len = 1e5 + 5;

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



int main(void)

{

	scanf("%d", &N);

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

	{

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

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

			++cnt[4];

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

			++cnt[2];

		else

			++ cnt[1];

	}

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

		printf("Yes");

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

		printf("Yes");

	else

		printf("No");

	return 0;

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

using namespace std;

int b,c,d;

int main()

{

	int n;

	cin>>n;

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

	{

		int a;

		cin>>a;

		if (a%4==0)

			b++;

		else

			if (a%2==0)

				c++;

			else

				d++;

	}

	if (d>b+1||(d==b+1&&c!=0)) cout<<"No";

	else cout<<"Yes";

	return 0;

}

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

#include<cstring>

//long long

const int len = 1e5 + 5;

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



int main(void)

{

	scanf("%d", &N);

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

	{

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

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

			++cnt[4];

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

			++cnt[2];

		else

			++ cnt[1];

	}

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

		printf("Yes");

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

		printf("Yes");

	else

		printf("No");

	return 0;

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

int n,a,x,y;

main(){

  std::cin>>n;

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

    std::cin>>a;

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

    else if(a%2==0)y++;

  }

  std::cout<<(x+y/2+1>n/2?"Yes\n":"No\n");

}


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

int n,a,x,y,i;

main(){

  for(scanf("%d",&n);i++<n;a%4?a%2?0:y++:x++)scanf("%d",&a);

  printf(x+y/2+1>n/2?"Yes\n":"No\n");

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

namespace chtholly{

typedef long long ll;

#define re0 register int

#define rec register char

#define rel register ll

#define gc getchar

#define pc putchar

#define p32 pc(' ')

#define pl puts("")

/*By Citrus*/

inline int read(){

  int x=0,f=1;char c=gc();

  for (;!isdigit(c);c=gc()) f^=c=='-';

  for (;isdigit(c);c=gc()) x=(x<<3)+(x<<1)+(c^'0');

  return f?x:-x;

  }

template <typename mitsuha>

inline bool read(mitsuha &x){

  x=0;int f=1;char c=gc();

  for (;!isdigit(c)&&~c;c=gc()) f^=c=='-';

  if (!~c) return 0;

  for (;isdigit(c);c=gc()) x=(x<<3)+(x<<1)+(c^'0');

  return x=f?x:-x,1;

  }

template <typename mitsuha>

inline int write(mitsuha x){

  if (!x) return 0&pc(48);

  if (x<0) x=-x,pc('-');

  int bit[20],i,p=0;

  for (;x;x/=10) bit[++p]=x%10;

  for (i=p;i;--i) pc(bit[i]+48);

  return 0;

  }

inline char fuhao(){

  char c=gc();

  for (;isspace(c);c=gc());

  return c;

  }

}using namespace chtholly;

using namespace std;

const int yuzu=1e5;

int cnt,cnt1,cnt2;

int main(){

int n=read();

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

  int x=read();

  if (!(x&1)){

    if (!(x>>1&1)){

      ++cnt1;

      }else{

      ++cnt2;

      }

    }

  }

if (cnt2/2+cnt1>=n/2) puts("Yes");

else puts("No");

}

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

const int maxn = 100000;

int main()

{

	int i = 0, j = 0, k = 0,n,value[maxn];

	scanf("%d", &n);

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

		{

			scanf("%d", &value[pos]);

			if (value[pos] % 4 == 0)

				i++;

			else if (value[pos] % 2 == 0)

				j++;

			else

				k++;

		}

		if (j == 0)

		{

			if(k>i+1)

				printf("No\n");

			else

				printf("Yes\n");

		}

		else if(j != 0)

		{

			if (k > i)

				printf("No\n");

			else

				printf("Yes\n");

		}

		return 0;

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

using namespace std;

int main()

{

	int n;

	cin>>n;

	int a[n];

	int t1=0,t2=0,t4=0;

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

	{

		int b;

		cin>>b;

		if(b%4==0)

		{

			a[i]=4;

			t4++;

		}

		else if(b%2==0)

		{

			a[i]=2;

			t2++;

		}

		else

		{

			a[i]=1;

			t1++;

		}

	}

	if(t4>=t1||(t2==0&&t4+1>=t1))

	{

		cout<<"Yes";

	}

	else

	{

		cout<<"No";

	}

	return 0;

}

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

const int maxn = 100000;

int main()

{

	int i = 0, j = 0, k = 0,n,value[maxn];

	scanf("%d", &n);

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

		{

			scanf("%d", &value[pos]);

			if (value[pos] % 4 == 0)

				i++;

			else if (value[pos] % 2 == 0)

				j++;

			else

				k++;

		}

		if (j == 0)

		{

			if(k>i+1)

				printf("No\n");

			else

				printf("Yes\n");

		}

		else if(j != 0)

		{

			if (k > i)

				printf("No\n");

			else

				printf("Yes\n");

		}

		return 0;

}
// Slower C++ solution:
//soale C

#include <bits/stdc++.h>

using namespace std;

const int N = 1e5 + 20;

typedef long long ll;

ll n, a[N], c[10], d = 0;

int main(){

	cin >> n;

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

		cin >> a[i];

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

			a[i] = 2;

			c[0] += 1;

		}

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

			a[i] = 1;

			c[1] += 1;

		}

		else{

			a[i] = 0;

			c[2] += 1;

		}

	}

	if(c[1] != 0){

		if(c[2] > c[0]){

			d = 1;

		}

	}

	else{

		if(c[2] > c[0] + 1){

			d = 1;

		}

	}

	if(d == 1){

		cout << "No";

	}

	else{

		cout << "Yes";

	}

	return 0;

}

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

const int maxn = 100000;

int main()

{

	int i = 0, j = 0, k = 0,n,value[maxn];

	scanf("%d", &n);

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

		{

			scanf("%d", &value[pos]);

			if (value[pos] % 4 == 0)

				i++;

			else if (value[pos] % 2 == 0)

				j++;

			else

				k++;

		}

		if (j == 0)

		{

			if(k>i+1)

				printf("No\n");

			else

				printf("Yes\n");

		}

		else if(j != 0)

		{

			if (k > i)

				printf("No\n");

			else

				printf("Yes\n");

		}

		return 0;

}
// Slower C++ solution:
#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";

	}

}

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

const int maxn = 100000;

int main()

{

	int i = 0, j = 0, k = 0,n,value[maxn];

	scanf("%d", &n);

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

		{

			scanf("%d", &value[pos]);

			if (value[pos] % 4 == 0)

				i++;

			else if (value[pos] % 2 == 0)

				j++;

			else

				k++;

		}

		if (j == 0)

		{

			if(k>i+1)

				printf("No\n");

			else

				printf("Yes\n");

		}

		else if(j != 0)

		{

			if (k > i)

				printf("No\n");

			else

				printf("Yes\n");

		}

		return 0;

}
// Slower C++ solution:
#define debug 0

#define test 0

#define CPLUS 1

#include <stdio.h>

#include <string.h>

#include <stdlib.h>

#include <math.h>

#include <string.h>

#if CPLUS

#include <iostream>

#include <stack>

#include <string>

#include<algorithm>

using namespace std;

#endif



int a[100005];





int check(int n1, int n2, int n4)

{

	if (n4 >= n1)

		return 1;

	else if (n1 == n4 + 1 && n2 == 0)

		return 1;

	else

		return 0;

}



int main(void)

{

#if debug

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

#endif

	int i, n;

	cin >> n;

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

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

		cin >> a[i];

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

			n4++;

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

			n2++;

		else

			n1++;

	}

#if test

	printf("%d %d %d", n1, n2, n4);

#endif

	if (check(n1, n2, n4))

		printf("Yes\n");

	else

		printf("No\n");

	return 0;

}

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

const int maxn = 100000;

int main()

{

	int i = 0, j = 0, k = 0,n,value[maxn];

	scanf("%d", &n);

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

		{

			scanf("%d", &value[pos]);

			if (value[pos] % 4 == 0)

				i++;

			else if (value[pos] % 2 == 0)

				j++;

			else

				k++;

		}

		if (j == 0)

		{

			if(k>i+1)

				printf("No\n");

			else

				printf("Yes\n");

		}

		else if(j != 0)

		{

			if (k > i)

				printf("No\n");

			else

				printf("Yes\n");

		}

		return 0;

}
// Slower C++ solution:
#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;	

}

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

const int maxn = 100000;

int main()

{

	int i = 0, j = 0, k = 0,n,value[maxn];

	scanf("%d", &n);

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

		{

			scanf("%d", &value[pos]);

			if (value[pos] % 4 == 0)

				i++;

			else if (value[pos] % 2 == 0)

				j++;

			else

				k++;

		}

		if (j == 0)

		{

			if(k>i+1)

				printf("No\n");

			else

				printf("Yes\n");

		}

		else if(j != 0)

		{

			if (k > i)

				printf("No\n");

			else

				printf("Yes\n");

		}

		return 0;

}