#include<bits/stdc++.h>
#define ll long long
#define MAX 1000005
#define MOD (ll)(1e9+7)
using namespace std;

ll cl(ll a, ll b)   {
    if(a%b==0) return a/b;
    else return a/b+1;
}

void solve()    {
    ll n,m;
    cin >> n >> m;
    if(m==0)    {
        cout << "1\n"; return;
    }
    ll a[m];
    for(int i=0; i<m; i++)  cin >> a[i];
    sort(a,a+m);
    ll minpos = 0;
    if(a[0]-1 != 0) minpos = a[0]-1;
    for(int i=1; i<m; i++)  {
        if(minpos == 0) {
            minpos = a[i]-a[i-1]-1;
        }
        if(a[i]-a[i-1]-1 != 0 && a[i]-a[i-1]-1 < minpos)    minpos = a[i]-a[i-1]-1;
    }
    if(minpos == 0) {
        minpos = n-a[m-1];
    }
    if(n-a[m-1] != 0 && n-a[m-1] < minpos)    minpos = n-a[m-1];
    //cout << minpos << endl;
    if(minpos == 0) {
        cout << 0 << endl;
        return;
    }
    ll ans = 0;
    if(a[0]-1 != 0) ans += cl(a[0]-1,minpos);
    for(int i=1; i<m; i++)  {
        if(a[i]-a[i-1]-1 != 0)    ans += cl(a[i]-a[i-1]-1,minpos);
    }
    if(n-a[m-1] != 0) ans += cl(n-a[m-1],minpos);
    cout << ans << endl;
}

int main()  {
    int n=1;
    //cin >> n;
    for(int i=1; i<=n; i++)  {
        solve();
    }
    return 0;
}
#include <algorithm>
#include <bitset>
//#include <cmath>
//#include <complex>
#include <cctype>
#include <cstdio>
#include <cstdint>
#include <deque>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <climits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <valarray>
#include <vector>
#include <unordered_set>
#include <unordered_map>

using namespace std;

int64_t INF = LLONG_MAX;

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    int N, M;
    cin >> N >> M;
    
    vector<int> A(N), B(M);
    
    for(int i = 0; i < N; i++){
        cin >> A.at(i);
    }
    
    for(int i = 0; i < M; i++){
        cin >> B.at(i);
    }
    
    int index = 0;
    set<int> ans;
    
    for(int tmp : A){
        if(index == M){
            ans.insert(tmp);
            continue;
        }
        
        bool flag = false;
        for(; index < M; index++){
            if(tmp == B.at(index)){
                flag = true;
                continue;
            }else if(tmp > B.at(index)){
                ans.insert(B.at(index));
            }else{
                break;
            }
        }
        
        if(flag == false){
            ans.insert(tmp);
        }
        
    }
    
    if(index != M){
        for(; index < M; index++){
            ans.insert(B.at(index));
        }
    }
    
    
    int count = 0;
    for(int tmp : ans){
        if(count == 0){
            cout << tmp;
        }else{
            cout << " " << tmp;
        }
        
        count++;
    }
    cout << endl;


    return 0;
}
