Daenerys Targaryen has an army consisting of k groups of soldiers, the i-th group contains ai soldiers. She wants to bring her army to the other side of the sea to get the Iron Throne. She has recently bought an airplane to carry her army through the sea. The airplane has n rows, each of them has 8 seats. We call two seats neighbor, if they are in the same row and in seats {1, 2}, {3, 4}, {4, 5}, {5, 6} or {7, 8}.

A row in the airplane
Daenerys Targaryen wants to place her army in the plane so that there are no two soldiers from different groups sitting on neighboring seats.

Your task is to determine if there is a possible arranging of her army in the airplane such that the condition above is satisfied.

Input
The first line contains two integers n and k (1 ≤ n ≤ 10000, 1 ≤ k ≤ 100) — the number of rows and the number of groups of soldiers, respectively.

The second line contains k integers a1, a2, a3, …, ak (1 ≤ ai ≤ 10000), where ai denotes the number of soldiers in the i-th group.

It is guaranteed that a1 + a2 + … + ak ≤ 8·n.

Output
If we can place the soldiers in the airplane print “YES” (without quotes). Otherwise print “NO” (without quotes).

You can choose the case (lower or upper) for each letter arbitrary.

Examples
inputCopy
2 2
5 8
outputCopy
YES
inputCopy
1 2
7 1
outputCopy
NO
inputCopy
1 2
4 4
outputCopy
YES
inputCopy
1 4
2 2 1 2
outputCopy
YES
Note
In the first sample, Daenerys can place the soldiers like in the figure below:

In the second sample, there is no way to place the soldiers in the plane since the second group soldier will always have a seat neighboring to someone from the first group.

In the third example Daenerys can place the first group on seats (1, 2, 7, 8), and the second group an all the remaining seats.

In the fourth example she can place the first two groups on seats (1, 2) and (7, 8), the third group on seats (3), and the fourth group on seats (5, 6).

思路分析:
考虑 4,以及 1,2,3;
自然先分配 4个的座位,然后看其剩下的余数;
对于3而言,肯定先分在4座位上面,因为如果放置在2个2上面,更优策略可以放4个;
对于2 来说,先放在4座位上面,那么1座位的数量++;否则放在2座位;最后选择放在2个1座位;
对于1,自然从1~4来放置,注意如果放在4位置,那么2座位同时更新++即可;

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define inf 0x3f3f3f3f
#define maxn 20005
const int mod=1e9+7;
#define eps 1e-5
#define pi acos(-1.0)

ll quickpow(ll a,ll b)
{
    ll ans=1;
    while(b){
        if(b&1){
            ans=ans*a;
        }
        a=a*a;
        b>>=1;
    }
    return ans;
}
ll gcd(ll a,ll b)
{
    return b==0?a:gcd(b,a%b);
}
int a[maxn];
int n,k;

int main()
{
    ios::sync_with_stdio(false);
    cin>>n>>k;
    priority_queue<int> q;
    int x;
    for(int i=0;i<k;i++){
        //int x;
        cin>>x;
        q.push(x);
    }
    int n1=n;// 4 个座位数量
    int n2=n*2;// 2 个座位数量
    int n3=0;// 4 个座位剩下的1 的数量
    while(!q.empty()){
        x=q.top();
        q.pop();
        if(x>=4){
            int d=x/4;
            if(d<=n1){
                n1-=d;
                if(x%4)q.push(x%4);
            }
            else {
                x-=n1*4;
                n1=0;
                n2-=(x+1)/2;
            }
        }
        else if(x==3){
            if(n1)n1--;
            else n2-=2;

        }
        else if(x==2){
            if(n1)n1--,n3++;
            else if(n2)n2--;
            else n3-=2;
        }
        else {
            if(n3)n3--;
            else if(n2)n2--;
            else n1--,n2++;
        }
        if(n1<0||n2<0||n3<0){
            cout<<"NO"<<endl;
            return 0;
        }
    }
    cout<<"YES"<<endl;
    return 0;
}