//#pragma GCC optimize ("O2")
//#pragma GCC target ("avx2")
//#include<bits/stdc++.h>
//#include<atcoder/all>
//using namespace atcoder;

#include<cstdio>
#include<cstring>

using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

const int CM = 1 << 17, CL = 12;
char cn[CM + CL], * ci = cn + CM + CL, * owa = cn + CM, ct;
const ll ma0 = 1157442765409226768;
const ll ma1 = 1085102592571150095;
const ll ma2 = 71777214294589695;
const ll ma3 = 281470681808895;
const ll ma4 = 4294967295;
inline int getint() {
	if (ci - owa > 0) {
		memcpy(cn, owa, CL);
		ci -= CM;
		fread(cn + CL, 1, CM, stdin);
	}
	ll tmp = *(ll*)ci;
	if ((tmp & ma0) ^ ma0) {
		int dig = 68 - __builtin_ctzll((tmp & ma0) ^ ma0);
		tmp = tmp << dig & ma1;
		tmp = tmp * 10 + (tmp >> 8) & ma2;
		tmp = tmp * 100 + (tmp >> 16) & ma3;
		tmp = tmp * 10000 + (tmp >> 32) & ma4;
		ci += (72 - dig >> 3);
	}
	else {
		tmp = tmp & ma1;
		tmp = tmp * 10 + (tmp >> 8) & ma2;
		tmp = tmp * 100 + (tmp >> 16) & ma3;
		tmp = tmp * 10000 + (tmp >> 32) & ma4;
		ci += 8;
		if ((ct = *ci++) >= '0') {
			tmp = tmp * 10 + ct - '0';
			if (*ci++ == '0') {
				tmp = tmp * 10;
				ci++;
			}
		}
	}
	return tmp;
}
int tmp[200001];
void pakuri_sort(int N, int A[]) {
	const int b = 8;
	rep(k, 4) {
		int kazu[1 << b] = {}, kazu2[1 << b] = {};
		rep(i, N) kazu[A[i] >> k * b & ((1 << b) - 1)]++;
		rep(i, (1 << b) - 1) kazu[i + 1] += kazu[i];
		for (int i = N - 1; i >= 0; i--) tmp[--kazu[A[i] >> k * b & ((1 << b) - 1)]] = A[i];
		k++;
		rep(i, N) kazu2[tmp[i] >> k * b & ((1 << b) - 1)]++;
		rep(i, (1 << b) - 1) kazu2[i + 1] += kazu2[i];
		for (int i = N - 1; i >= 0; i--) A[--kazu2[tmp[i] >> k * b & ((1 << b) - 1)]] = tmp[i];
	}
}

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


	int N = getint(), M = getint();

	int A[200010];
	rep1(i, M) A[i] = getint();
	A[0] = 0;
	A[M + 1] = N + 1;
	pakuri_sort(M, A + 1);

	int saishou = 2e9;
	int t = 0;
	rep(i, M + 1) {
		int kari = A[i + 1] - A[i] - 1;
		if (kari) {
			if (kari < saishou) saishou = kari;
			tmp[t++] = kari;
		}
	}

	if (saishou > 1.5e9) {
		printf("0");
		return 0;
	}

	ll kotae = 0;
	rep(i, t) kotae += (tmp[i] + saishou - 1) / saishou;

	printf("%d\n", kotae);

	Would you please return 0;
}
#include <bits/stdc++.h>
//#include <atcoder/all>
using namespace std;
#define rep(i,n) for(ll i=0; i<n; i++)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rrep(i,n) for(ll i=n-1; i>=0; i--)
#define fi first
#define se second
#define pcnt __builtin_popcountll
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;
typedef pair<ll,Pll> PlP;
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
template<class A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}cout << "\n";}
template<typename T> void drop(const T &x){cout<<x<<endl;exit(0);}
string zero_padding(int val, int nf){ ostringstream sout;sout << setfill('0') << setw(nf) << val; return sout.str();};
const ld eps = 1e-10;
ull mo = 1000000007;
ld PI=asin(1)*2;
//using namespace atcoder;
int main(){ 
    ll N;
    cin >> N;
    vector<ld> A(N),B(N),C(N),D(N);
    ld aw=0,bw=0,cw=0,dw=0;
    rep(i,N){
        cin >> A[i] >> B[i];
        aw += A[i]; bw += B[i]; 
        // A[i] *= N;
        // B[i] *= N;
    }
    aw /= N; bw /= N;
    rep(i,N){
        cin >> C[i] >> D[i];
        cw += C[i]; dw += D[i]; 
    //     C[i] *= N;
    //     D[i] *= N;
    }
    cw /= N; dw /= N;
    rep(i,N){
        A[i] += (-aw);
        B[i] += (-bw);
    }
    rep(i,N){
        C[i] += (-cw);
        D[i] += (-dw);
    }
    vector<pair<ld,ld>> sp(N),tp(N);
    rep(i,N){
        sp[i].fi = A[i];
        sp[i].se = B[i];
    }
    rep(i,N){
        tp[i].fi = C[i];
        tp[i].se = D[i];
    }
    sort(sp.begin(), sp.end(), [](const auto &p1, const auto &p2) {
        if(-eps + atan2(p2.second, p2.first) <= atan2(p1.second, p1.first) && atan2(p1.second, p1.first) <= eps + atan2(p2.second, p2.first)){
            return p1.first*p1.first + p1.second*p1.second < p2.first*p2.first + p2.second*p2.second;
        }
        return atan2(p1.second, p1.first) < atan2(p2.second, p2.first);
    });
    sort(tp.begin(), tp.end(), [](const auto &p1, const auto &p2) {
        if(-eps + atan2(p2.second, p2.first) <= atan2(p1.second, p1.first) && atan2(p1.second, p1.first) <= eps + atan2(p2.second, p2.first)){
            return p1.first*p1.first + p1.second*p1.second < p2.first*p2.first + p2.second*p2.second;
        }
        return atan2(p1.second, p1.first) < atan2(p2.second, p2.first);
    });
    // cout << endl;
    // rep(i,N){
    //     cout << "(" << sp[i].fi << "," << sp[i].se << ")" << endl;
    // }
    // rep(i,N){
    //     cout << "(" << tp[i].fi << "," << tp[i].se << ")" << endl;
    // }
    if(N == 1) drop("Yes");
    rep(d,N){
        ll cnt =0;
        ld xs = sp[0].fi; 
        ld ys = sp[0].se;
        ld xt = tp[d].fi;
        ld yt = tp[d].se;
        ld angle = atan2l(yt,xt)-atan2l(ys,xs);
        rep(i,N){
            ld x1 = sp[i].fi*cosl(angle)-sp[i].se*sinl(angle);
            ld y1 = sp[i].fi*sinl(angle)+sp[i].se*cosl(angle);
            bool f = 0;
            rep(j,N){
                ld x2 = tp[j].fi;
                ld y2 = tp[j].se;
                if( x2 - eps <= x1 && x1 <= x2 + eps){
                    if( y2 - eps <= y1 && y1 <= y2 + eps){
                        f = 1;
                    }
                }
            }
            cnt += f;
        }
        if(cnt == N) drop("Yes");
    }
    cout << "No" << endl;
}