#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#include <bits/stdc++.h>
using namespace std;
typedef long long int lld;

const lld N = 200043;
const lld MOD = 1000000007;

lld add(lld x, lld y)
{
    x =((x%MOD)+(y%MOD))%MOD;
    while(x >= MOD) x -= MOD;
    while(x < 0) x += MOD;
    return x;
}

lld mul(lld x, lld y)
{
    return ((x%MOD)*(y%MOD))% MOD;
}

lld binpow(lld x, lld y)
{
    lld z = 1;
    while(y)
    {
        if(y & 1) z = mul(z, x);
        x = mul(x, x);
        y >>= 1;
    }
    return z;
}

lld inv(lld x)
{
    return binpow(x, MOD - 2);
}

lld divide(lld x, lld y)
{
    return mul(x, inv(y));
}

// Combinations

/*
lld fact[N];

void precalc()
{
    fact[0] = 1;
    for(lld i = 1; i < N; i++)
        fact[i] = mul(fact[i - 1], i);
}

lld C(lld n, lld k)
{   if(k>n)
        return 0;
    return divide(fact[n], mul(fact[k], fact[n - k]));
}
*/

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    lld t,i,j;
    //cin>>t;
    t=1;
    while(t--)
    {
        lld n,m;
        cin>>n>>m;
        set<lld>s;
        s.insert(0);
        s.insert(n+1);
        for(i=0;i<m;i++)
        {
            lld a;
            cin>>a;
            s.insert(a);
        }
        if(m==0)
        {
            cout<<1<<endl;
            return 0;
        }
        if(m==n)
        {
            cout<<0<<endl;
            return 0;
        }
        vector<lld>v;
        for(lld x:s)
            v.push_back(x);
        cout<<endl;
        lld ma=LLONG_MAX;
        for(i=1;i<v.size();i++)
        {
            if(v[i]-v[i-1]-1!=0)
                ma=min(ma,v[i]-v[i-1]-1);
        }
        lld ans=0;
        for(i=1;i<v.size();i++)
            {
                ans+=(v[i]-v[i-1]-1)/ma;
                if((v[i]-v[i-1]-1)%ma!=0)
                    ans++;
            }
        cout<<ans<<endl;
    }
}



#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;

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

int main() {

    string S;
    cin >> S;

    if(S.size()<=3){
        sort(S.begin(), S.end());
        do{
            int n = stoi(S);
            if(n%8 == 0){
                cout << "Yes" << endl;
                return 0;
            }
        }while(next_permutation(S.begin(), S.end()));
        cout << "No" << endl;
        return 0;
    }

    vector<int> nums(10, 0);

    for(auto s:S){
        if(nums.at(s-'0')<3){
            ++nums.at(s-'0');
        }
    }

    string V = "";
    for(int i=1; i<10; ++i){
        rep(j, nums.at(i)) V += (to_string(i));
    }

    do{

        int n = stoi(V.substr(V.size()-3));
        if(n%8 == 0){
            cout << "Yes" << endl;
            return 0;
        }

    }while(next_permutation(V.begin(), V.end()));
    cout << "No" << endl;
}
