///Bismillahir Rahmanir Rahim
#include "bits/stdc++.h"

#define                           ll                          long long
#define                           int                         ll
#define                           fi                          first
#define                           si                          second
#define                           mp                          make_pair
#define                           pb                          push_back
#define                           pi                          pair<int,int>
#define                           nd(a,b,c)                   mp(mp(a,b),c)
#define                           clr(x)                      memset(x,0,sizeof(x));
#define                           f(i,l,r)                    for(int i=l;i<=r;i++)
#define                           rf(i,r,l)                   for(int i=r;i>=l;i--)
#define                           done(i)                     cout<<"done = "<<i<<endl;
#define                           show(x,y)                   cout<<x<<" : ";for(auto z:y)cout<<z<<" ";cout<<endl;
#define                           fast                        ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

using namespace std;

const ll inf=2e18;
const int mod=1e9+7;
const int M=200005;
int a[M];
 main()

{
    fast
    int n,m;
    cin>>n>>m;
    if(m==0)
    {
        cout<<"1\n";return 0;
    }
    f(i,1,m)
    {
        cin>>a[i];
    }
    sort(a+1,a+m+1);
    m=unique(a+1,a+m+1)-a-1;
    a[0]=0;
    a[m+1]=n+1;
    int mn=n;
    int ses=0;
    f(i,1,m+1)
    {
       int lft=a[i-1]+1;
       int rgt=a[i]-1;
       if(lft<=rgt)
       {
           mn=min(mn,rgt-lft+1);
       }
    }
    f(i,1,m+1)
    {
       int lft=a[i-1]+1;
       int rgt=a[i]-1;
       if(lft<=rgt)
       {
           int len=rgt-lft+1;
           ses+=((len+mn-1)/mn);
       }
    }
    cout<<ses<<"\n";
    return 0;

}




































#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
#include <cstring>
#include <map>
#include <set>
#include <numeric>
#include <cassert>

using namespace std;

void setIO(const string &name = "") {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    if (name.length()) {
        freopen((name + ".in").c_str(), "r", stdin);
        freopen((name + ".out").c_str(), "w", stdout);
    }
}

typedef long long ll;
#define int ll
#define INF int(1e18) + 15
#define mod 1000000007
#define DO if(true)
#define vt vector

#define rep(i, a, b) for(auto (i)=a;(i)<(b);(i)++)
#define trav(a, x) for(auto& (a): (x))

struct RMQ {
    int size = 1;
    vt<int> v, logTable;
    vt<vt<int>> table;

    void makeLogTable(){
        logTable.assign(size + 1, 0);
        rep(i, 2, size + 1){
            logTable[i] = logTable[i / 2] + 1;
        }
    }

    void makeTable(){
        table.assign(logTable.back() + 1, vt<int>(size));
        table[0] = v;
        for(int row = 1; row <= logTable.back(); row++){
            for(int i = 0; (i + (1 << row)) <= size; i++){
                table[row][i] = min(table[row - 1][i], table[row - 1][i + (1 << (row - 1))]);
            }
        }
    }

    void init(int n, const vt<int>& x){
        size = n;
        v = x;

        makeLogTable();
        makeTable();
    }

    int calc(int l, int r){
        int lg = logTable[r - l];
        int res = min(table[lg][l], table[lg][r - (1 << lg)]);
        return res;
    }
};

#define N int(1e4) + 10
int n;
vt<int> a;

signed main() {
    setIO();

    cin >> n;
    a.resize(n);
    trav(c, a){
        cin >> c;
    }

    RMQ rmq;
    rmq.init(n, a);

    auto binLeft = [&](int idx){
        int lo = 0, hi = idx;
        int res = idx;
        while(lo <= hi){
            int mid = (lo + hi) / 2;
            if(rmq.calc(mid, idx + 1) == a[idx]){
                res = mid;
                hi = mid - 1;
            }else {
                lo = mid + 1;
            }
        }
        return res;
    };

    auto binRight = [&](int idx){
        int lo = idx, hi = n - 1;
        int res = idx;
        while(lo <= hi){
            int mid = (lo + hi) / 2;
            if(rmq.calc(idx, mid + 1) == a[idx]){
                res = mid;
                lo = mid + 1;
            }else {
                hi = mid - 1;
            }
        }
        return res;
    };

    vt<int> s(n), e(n);
    rep(i, 0, n){
        s[i] = binLeft(i);
        e[i] = binRight(i);
    }

    int ans = *max_element(a.begin(), a.end());
    rep(i, 0, n){
        ans = max(ans, (e[i] - s[i] + 1) * a[i]);
    }
    cout << ans << '\n';
    return 0;
}