#include<bits/stdc++.h>
#include<iostream>
#include<string>
#include<cmath>
#include<cstdio>
#include<cctype>
#include<cstring>
#include<iomanip>
#include<cstdlib>
#include<ctime>
#include<set>
#include<map>
#include<utility>
#include<queue>
#include<vector>
#include<stack>
#include<sstream>
#include<algorithm>
#define forn(i,a,b)for(int i=(a),_b=(b);i<=_b;i++)
#define fore(i,b,a)for(int i=(b),_a=(a);i>=_a;i--)
#define rep(i,n)for(int i=0,_n=n;i<n;i++)
#define pii pair<int,int>
#define m_p make_pair
#define pb push_back
#define ld long double
#define fi first
#define se second
#define ull unsigned long long
#define mod 1000000007
#define md 998244353
#define x1 XZVJDFADSPFOE
#define y1 GASDIJSLDAEJF
#define x2 DFDAJKVOHKWIW
#define y2 PSFSAODSXVNMQ
#define foreach(i,c) for(__typeof(c.begin())i=(c.begin());i!=(c).end();i++)
#define int long long
using namespace std;
inline void read(int &x){
	short negative=1;
    x=0;
    char c=getchar();
    while(c<'0'||c>'9'){
		if(c=='-')negative=-1;
		c=getchar();
	}
    while(c>='0'&&c<='9')x=(x<<3)+(x<<1)+(c^48),c=getchar();
    x*=negative;
}
const int M=200010;
int n,m;
map<int,int>dp,tmp;
pair<int,int>p[M];
int ans=0;
bool in(int x){
	return x>=0&&x<=2*n;
}
signed main(){
	cin>>n>>m;
	rep(i,m){
		cin>>p[i].fi>>p[i].se;
	}
	sort(p,p+m);
	dp[n]=1;
	int last=-1;
	rep(i,m){
		int cur=p[i].se;
		if(p[i].fi!=last){
			last=p[i].fi;
			map<int,int>::iterator it;
			for(it=tmp.begin();it!=tmp.end();it++){
				dp[it->fi]=it->se;
			}
			tmp.clear();
		}
		if(in(cur)){
			if(dp[cur]==1)tmp[cur]=-1;
		}
		if(in(cur-1)){
			if(dp[cur-1]==1)tmp[cur]=1;
		}
		if(in(cur+1)){
			if(dp[cur+1]==1)tmp[cur]=1;
		}
	}
	map<int,int>::iterator it;
	for(it=tmp.begin();it!=tmp.end();it++){
		dp[it->fi]=it->se;
	}
	tmp.clear();
	for(it=dp.begin();it!=dp.end();it++){
		if(it->se==1)ans++;
	}
	cout<<ans<<"\n";
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n=4;
    vector<int> arr(n);
    int sum=0;
    for(int i=0;i<=n-1;i++)
    {
        cin >> arr[i];
        sum+=arr[i];
    }
    string ans="No";
    for(int i=0;i<=n-1;i++)
    {
        if(arr[i]==sum-arr[i])
        {
            ans="Yes";
        }
    }
    for(int i=0;i<=n-1;i++)
    {
        for(int j=i+1;j<=n-1;j++)
        {
            int g=arr[i]+arr[j];
            if(g==sum-g)
            {
                ans="Yes";
            }
        }
    }
    cout << ans;
}
