stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
////////////////////////// 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;

    }

}




// Faster C++ solution for the same problem (measured speedup: 5.345576463413128x):
#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;

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

#include<cstdio>

#include<string>

#include<vector>

#include<queue>

#include<cmath>

#include<algorithm>

#include<iomanip>

#include<functional>

#include<set>

#include<map>

#include<utility>

#define ul unsigned long long int

#define ll long long int

#define MAX 1000000+1

using namespace std;

#define F first

#define S second

#define pi 2*acos(0.0)

#define PB push_back

#define Pp push

#define LSTAGE 1

int arr[200010];

ll bfs(vector<int> a[])

{

    queue<int>v;

    v.push(1);

    int t;

    arr[1] = 0;

    int x;

    while(v.size())

    {

        t = v.front();

        v.pop();

        if(arr[t]==2)

            return 1;

        for(int i= 0; i < a[t].size(); i++)

        {

            x = a[t][i];

            if(arr[x]==-1)

            {

                v.push(x);

                arr[x] = arr[t]+1;



            }

        }



    }

    return 0;



}





int main()

{

    ll n, r, t, f, s;

    t = f = s = 0;

    cin >> n;

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

    {

        cin >> r;

        if(r%4==0)

            f++;

        else if(r%4==2)

            t++;

        else

            s++;

    }

    n--;

    if(t)

        t--;





    n -= t;

    n -= f*2;

    if(n <= 0)



        cout <<"Yes";

    else

        cout << "No";





    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.329063844651505x):
#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;

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

#include<cstdio>

#include<string>

#include<vector>

#include<queue>

#include<cmath>

#include<algorithm>

#include<iomanip>

#include<functional>

#include<set>

#include<map>

#include<utility>

#define ul unsigned long long int

#define ll long long int

#define MAX 1000000+1

using namespace std;

#define F first

#define S second

#define pi 2*acos(0.0)

#define PB push_back

#define Pp push

#define LSTAGE 1

int arr[200010];

ll bfs(vector<int> a[])

{

    queue<int>v;

    v.push(1);

    int t;

    arr[1] = 0;

    int x;

    while(v.size())

    {

        t = v.front();

        v.pop();

        if(arr[t]==2)

            return 1;

        for(int i= 0; i < a[t].size(); i++)

        {

            x = a[t][i];

            if(arr[x]==-1)

            {

                v.push(x);

                arr[x] = arr[t]+1;



            }

        }



    }

    return 0;



}





int main()

{

    ll n, r, t, f, s;

    t = f = s = 0;

    cin >> n;

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

    {

        cin >> r;

        if(r%4==0)

            f++;

        else if(r%2==0)

            t++;

        else

            s++;

    }

    if(t)

        s++;

    if((f+s)/2 <= f)

        cout <<"Yes";

    else

        cout << "No";





    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.329863643051584x):
#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;

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

using namespace std;

int main(){

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

	cin>>n;

	while(n--){

		int temp;

		cin>>temp;

		if(temp%4==0) a4++;

		else if(temp%2==0) a2++;

		else a1++;

	}

	if(a2==0){

		if(a4+1>=a1) cout<<"Yes";

		else cout<<"No";

	}else {

		if(a4>=a1) cout<<"Yes";

		else cout<<"No";

	}

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.290524393026792x):
#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;

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

//#include<algorithm>

using namespace std;

int main()

{

    int n, num_2 = 0, num_4 = 0, num_not24 = 0, tmp;

    bool is_luck;

    scanf("%d", &n);

    while(n--)

    {

        scanf("%d", &tmp);

        if(tmp % 4 == 0)

            num_4++;

        else if(tmp % 2 == 0)

            num_2++;

        else

            num_not24++;

    }

    if(num_2 != 0)

    {

        if(num_4 >= num_not24)

            is_luck = true;

        else

            is_luck = false;

    }

    else

    {

        if(num_4 >= num_not24 - 1)

            is_luck = true;

        else

            is_luck = false;

    }

    if(is_luck)

        printf("Yes\n");

    else

        printf("No\n");

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.230259737970467x):
#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;

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

#include<string>

using namespace std;

int d,t,n,s;



int main()

{

	d=0;t=0;cin>>n;

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

	{

		cin>>s;

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

		else if(s%2==0)d++;

	}

	if(2*t+d>=n)cout<<"Yes";

	else if(d==0&&2*t+1>=n)cout<<"Yes";

	else cout<<"No";

}

// Faster C++ solution for the same problem (measured speedup: 5.288778725620373x):
#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;

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

#include<vector>

#define MAXN 100001



using namespace std;



int a[MAXN];



int main()

{

    int N;

    scanf("%d",&N);

    int count2=0,count4=0;

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

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

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

            count2++;

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

            count4++;

    }

    if((3+(count4-1)*2)>=(N-(count2/2*2)))

        printf("Yes\n");

    else

        printf("No\n");

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.232745606370039x):
#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;

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

using namespace std;

 







int main() {

 



  int n;

  cin>>n;



  vector<int> a(n);

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

    cin>>a.at(i);

  }



  int cnt4=0,cnt2=0;

  //4の倍数

  //4の倍数出ないが、2の倍数/2

  //の合計がn/2より大きい

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

    if(a.at(i)%4==0)

      cnt4++;

    else if(a.at(i)%2==0)

      cnt2++;

  }



  if(cnt4+cnt2/2>=n/2)

    cout<<"Yes"<<endl;

  else 

    cout<<"No"<<endl;



	return 0;

}

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





int main() {

 



  int n;

  scanf("%d",&n);



  int cnt4=0,cnt2=0;

  //4の倍数

  //4の倍数出ないが、2の倍数/2

  //の合計がn/2より大きい

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

    int wk;

    scanf("%d",&wk);

    if(wk%4==0)

      cnt4++;

    else if(wk%2==0)

      cnt2++;

  }



  if(cnt4+cnt2/2>=n/2)

    printf("Yes\n");

  else 

    printf("No\n");



	return 0;

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

using namespace std;

 







int main() {

 



  int n;

  cin>>n;



  int cnt4=0,cnt2=0;

  //4の倍数

  //4の倍数出ないが、2の倍数/2

  //の合計がn/2より大きい

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

    int wk;

    cin>>wk;

    if(wk%4==0)

      cnt4++;

    else if(wk%2==0)

      cnt2++;

  }



  if(cnt4+cnt2/2>=n/2)

    cout<<"Yes"<<endl;

  else 

    cout<<"No"<<endl;



	return 0;

}

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





int main() {

 



  int n;

  scanf("%d",&n);



  int cnt4=0,cnt2=0;

  //4の倍数

  //4の倍数出ないが、2の倍数/2

  //の合計がn/2より大きい

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

    int wk;

    scanf("%d",&wk);

    if(wk%4==0)

      cnt4++;

    else if(wk%2==0)

      cnt2++;

  }



  if(cnt4+cnt2/2>=n/2)

    printf("Yes\n");

  else 

    printf("No\n");



	return 0;

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

using namespace std;

int main()

{

    int n,i,j,odd=0,even=0,four=0;

    scanf("%d",&n);

    int a[n+10];

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

    {

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

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

        {

            four++;

        }

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

        {

            even++;

        }

        else

        {

            odd++;

        }

    }

   if(odd>four)

   {

       int x=odd-four;

       if(x==1&&(2*four+x)==n)

       {

           printf("Yes");

       }

       else

       {

           printf("No");

       }



   }

   else

   {

       printf("Yes");

   }

   return 0;

}


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



int main(void)

{

    int c4=0,c1=0;

    int N,x,i;

    scanf("%d",&N);

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

    {

        scanf("%d",&x);

        if(x%2==0)

        {

            if(x%4==0)

                c4++;

        }

        else

            c1++;

    }

    if(N%2==0)

    {

        if(c4>=c1)

            printf("Yes\n");

        else

            printf("No\n");

    }

    else

    {

        if(c4+1>=c1)

            printf("Yes\n");

        else

            printf("No\n");

    }

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

using namespace std;

int main()

{

	int i,N,count2=0,count4=0,countodd=0;

	cin>>N;

	long long ara[N];

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

		cin>>ara[i];

	}

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

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

			count2++;

		}

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

			count4++;

		}

		if(ara[i]%2!=0){

			countodd++;

		}

	}

	if(count2+count4==N){

		cout<<"Yes";

		return 0;

	}

	if(count4>=countodd&&count2>=2){

		cout<<"Yes";

		return 0;

	}

	else{

		if(count4>=N/2){

			cout<<"Yes";

		}

		else{

			cout<<"No";

		}

	}

	return 0;

}

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



int main(void)

{

    int c4=0,c1=0;

    int N,x,i;

    scanf("%d",&N);

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

    {

        scanf("%d",&x);

        if(x%2==0)

        {

            if(x%4==0)

                c4++;

        }

        else

            c1++;

    }

    if(N%2==0)

    {

        if(c4>=c1)

            printf("Yes\n");

        else

            printf("No\n");

    }

    else

    {

        if(c4+1>=c1)

            printf("Yes\n");

        else

            printf("No\n");

    }

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

using namespace std ;

int cnt , cnt4 , cnt2 ;

int main()

{

	int n ;

	cin >> n ;

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

	{

		int x ;

		cin >> x ;

		x = x % 4 ;

		if ( x == 0 ) 

			cnt4 ++  ;

		else if ( x == 2 ) 

			cnt2 ++ ;

	}

	int cnt = n-cnt2-cnt4 ;

	if ( cnt2 ) 

	{

		if ( cnt4 >= cnt ) 

			return cout<<"Yes\n" , 0 ;



	}

	else

	{

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

			return cout << "Yes\n" , 0 ;



	}

	cout << "No" << "\n" ;

}

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



int main(void)

{

    int c4=0,c1=0;

    int N,x,i;

    scanf("%d",&N);

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

    {

        scanf("%d",&x);

        if(x%2==0)

        {

            if(x%4==0)

                c4++;

        }

        else

            c1++;

    }

    if(N%2==0)

    {

        if(c4>=c1)

            printf("Yes\n");

        else

            printf("No\n");

    }

    else

    {

        if(c4+1>=c1)

            printf("Yes\n");

        else

            printf("No\n");

    }

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

using namespace std;

int main()

{

    int n,i,j,odd=0,even=0,four=0;

    scanf("%d",&n);

    int a[n+10];

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

    {

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

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

        {

            four++;

        }

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

        {

            even++;

        }

        else

        {

            odd++;

        }

    }

   if(odd>four)

   {

       int x=odd-four;

       if(x==1&&(2*four+x)==n)

       {

           printf("Yes");

       }

       else

       {

           printf("No");

       }



   }

   else

   {

       printf("Yes");

   }

   return 0;

}


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

//#include<algorithm>

//#include<math.h>

//#include<stack>

//#include<queue>

//using namespace std;



int a[100005]={0};



int main(){

	int n,i,num,p;

	while(scanf("%d",&n)==1){

		num=0;

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

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

		   }

		   

		   if(n%2==1) p=(n-1)/2;

		   else p=n/2;

		   

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

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

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

		   }

		   

		   p=p*2;

		   if(num>=p) printf("Yes\n");

		   else printf("No\n");

	}

	return 0;

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

using namespace std;

int main()

{

	int i,N,count2=0,count4=0,countodd=0;

	cin>>N;

	long long ara[N];

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

		cin>>ara[i];

	}

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

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

			count2++;

		}

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

			count4++;

		}

		if(ara[i]%2!=0){

			countodd++;

		}

	}

	if(count2+count4==N){

		cout<<"Yes";

		return 0;

	}

	if(count4>=countodd&&count2>=2){

		cout<<"Yes";

		return 0;

	}

	else{

		if(count4>=N/2){

			cout<<"Yes";

		}

		else{

			cout<<"No";

		}

	}

	return 0;

}

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

//#include<algorithm>

//#include<math.h>

//#include<stack>

//#include<queue>

//using namespace std;



int a[100005]={0};



int main(){

	int n,i,num,p;

	while(scanf("%d",&n)==1){

		num=0;

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

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

		   }

		   

		   if(n%2==1) p=(n-1)/2;

		   else p=n/2;

		   

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

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

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

		   }

		   

		   p=p*2;

		   if(num>=p) printf("Yes\n");

		   else printf("No\n");

	}

	return 0;

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

using namespace std ;

int cnt , cnt4 , cnt2 ;

int main()

{

	int n ;

	cin >> n ;

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

	{

		int x ;

		cin >> x ;

		x = x % 4 ;

		if ( x == 0 ) 

			cnt4 ++  ;

		else if ( x == 2 ) 

			cnt2 ++ ;

	}

	int cnt = n-cnt2-cnt4 ;

	if ( cnt2 ) 

	{

		if ( cnt4 >= cnt ) 

			return cout<<"Yes\n" , 0 ;



	}

	else

	{

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

			return cout << "Yes\n" , 0 ;



	}

	cout << "No" << "\n" ;

}

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

//#include<algorithm>

//#include<math.h>

//#include<stack>

//#include<queue>

//using namespace std;



int a[100005]={0};



int main(){

	int n,i,num,p;

	while(scanf("%d",&n)==1){

		num=0;

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

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

		   }

		   

		   if(n%2==1) p=(n-1)/2;

		   else p=n/2;

		   

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

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

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

		   }

		   

		   p=p*2;

		   if(num>=p) printf("Yes\n");

		   else printf("No\n");

	}

	return 0;

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

#include <algorithm>

#include <cstring>

#include <stdio.h>

#include <cstring>

#include <string.h>

using namespace std;



int main()

{

		int n;

		cin >> n;

		int four = 0, two = 0;

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

		{

			int x;

			cin >> x;

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

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

		}

		two = max(two - 1, 0);

		if (four * 2 + two >= n - 1)

			cout << "Yes" << endl;

		else cout << "No" << endl;

}

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

//#include<algorithm>

//#include<math.h>

//#include<stack>

//#include<queue>

//using namespace std;



int a[100005]={0};



int main(){

	int n,i,num,p;

	while(scanf("%d",&n)==1){

		num=0;

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

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

		   }

		   

		   if(n%2==1) p=(n-1)/2;

		   else p=n/2;

		   

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

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

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

		   }

		   

		   p=p*2;

		   if(num>=p) printf("Yes\n");

		   else printf("No\n");

	}

	return 0;

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

using namespace std;

int main()

{

    int n,i,j,odd=0,even=0,four=0;

    scanf("%d",&n);

    int a[n+10];

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

    {

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

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

        {

            four++;

        }

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

        {

            even++;

        }

        else

        {

            odd++;

        }

    }

   if(odd>four)

   {

       int x=odd-four;

       if(x==1&&(2*four+x)==n)

       {

           printf("Yes");

       }

       else

       {

           printf("No");

       }



   }

   else

   {

       printf("Yes");

   }

   return 0;

}


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



int main(void)

{

	int a1count=0,a2count=0,a4count=0;

	int i,N,x;

	scanf("%d",&N);

	while(N--)

	{

		scanf("%d",&x);

		if(x%4==0)

			a4count++;

		else if(x%2==0)

			a2count++;

		else

			a1count++;

	}

	if(a2count>0 && a1count<=a4count)

		printf("Yes\n");

	else if(a2count==0 && a1count<=a4count+1)

		printf("Yes\n");

	else

		printf("No\n");



	return 0;

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

using namespace std;

int main()

{

	int i,N,count2=0,count4=0,countodd=0;

	cin>>N;

	long long ara[N];

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

		cin>>ara[i];

	}

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

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

			count2++;

		}

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

			count4++;

		}

		if(ara[i]%2!=0){

			countodd++;

		}

	}

	if(count2+count4==N){

		cout<<"Yes";

		return 0;

	}

	if(count4>=countodd&&count2>=2){

		cout<<"Yes";

		return 0;

	}

	else{

		if(count4>=N/2){

			cout<<"Yes";

		}

		else{

			cout<<"No";

		}

	}

	return 0;

}

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



int main(void)

{

	int a1count=0,a2count=0,a4count=0;

	int i,N,x;

	scanf("%d",&N);

	while(N--)

	{

		scanf("%d",&x);

		if(x%4==0)

			a4count++;

		else if(x%2==0)

			a2count++;

		else

			a1count++;

	}

	if(a2count>0 && a1count<=a4count)

		printf("Yes\n");

	else if(a2count==0 && a1count<=a4count+1)

		printf("Yes\n");

	else

		printf("No\n");



	return 0;

}