#include <bits/extc++.h>
using namespace std;
using ll = long long;
#define REP(i,n) for(int i=0;i<int(n);i++)
#define FOR(i,a,b) for(int i=a;i<=int(b);i++)
#define ALL(x) x.begin(),x.end()
#define MOD (ll)1000000007
set<ll> ans;
vector<pair<ll, ll>> xy;

signed main() {
  ll n;
  int m;
  cin >> n >> m;
  ans.insert(n);
  xy.resize(m);
  REP(i, m){
    ll x, y;
    cin >> x >> y;
    xy[i] = make_pair(x, y);
  }
  ll xb = 0;
  
  sort(xy.begin(), xy.end());
  if(m > 0) { 
    xb = xy[0].first;
  }
  vector<ll> dellist(0);
  vector<ll> addlist(0);
  REP(i, m){
    ll x, y;
    tie(x, y) = xy[i];
    if(xb != x){
      for(ll del: dellist){
        if(ans.find(del) != ans.end()) ans.erase(del);
      }
      for(ll add: addlist){
        if(ans.find(add) == ans.end()) ans.insert(add);
      }
      dellist.clear();
      addlist.clear();
    }
    if(ans.find(y) != ans.end()){
      dellist.push_back(y);
      
    }
    if(y - 1 >= 0){
      if(ans.find(y - 1) != ans.end()){
        addlist.push_back(y);
      }
    }
    if(y + 1 <= 2 * n){
      if(ans.find(y + 1) != ans.end()){
        addlist.push_back(y);
      }
    }
    xb = x;
  }
  for(ll del: dellist){
    if(ans.find(del) != ans.end()) ans.erase(del);
  }
  for(ll add: addlist){
    if(ans.find(add) == ans.end()) ans.insert(add);
  }
  cout << ans.size();
  return 0;
}
#include<bits/stdc++.h>
using namespace std;

#define Mod(x) (x>=P)&&(x-=P)||(x<0)&&(x+=P)
#define rep(i,a,b) for(ll i=a,i##end=b;i<=i##end;++i)
#define drep(i,a,b) for(ll i=a,i##end=b;i>=i##end;--i)
#define erep(i,a) for(ll i=hd[a];i;i=nxt[i])

typedef long long ll;
void Max(ll &x,ll y){(x<y)&&(x=y);}
void Min(ll &x,ll y){(x>y)&&(x=y);}

bool vio;
char IO;
ll rd(ll res=0){
	bool f=0;
	while(IO=getchar(),IO<48||IO>57)
		f=IO=='-';
	do res=(res<<1)+(res<<3)+(IO^48);
	while(IO=getchar(),isdigit(IO));
	return f?-res:res;
}
const ll M=3e6+10,P=1e9+7;
ll fac[M],inv[M];
ll Pow(ll a,ll b){
	ll res=1;
	for(;b;b>>=1,a=a*a%P)
		if(b&1)res=res*a%P;
	return res;
}
ll C(ll n,ll m){
	if(n<m||n<0||m<0)return 0;
	return fac[n]*inv[m]%P*inv[n-m]%P;
}
bool let;
int main(){
	cerr<<(&vio-&let)/1024.0/1024<<endl;
	ll n=rd(),m=rd(),q=rd();
	rep(i,fac[0]=1,n+m+1)fac[i]=fac[i-1]*i%P;
	inv[n+m]=Pow(fac[n+m],P-2);
	drep(i,n+m,1)inv[i-1]=inv[i]*i%P;
	if(n>m+q)return puts("0"),0;
	printf("%lld",(C(n+m,n)-C(n+m,m+q+1)+P)%P);
	return 0;
}
