#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define per(i,a,n) for(int i=n;i>=1;i--)
typedef long long ll;
typedef unsigned long long ull;
const ll mod=1e9+7;
const int INF=0x3f3f3f3f;
int h,w,n;
const int maxn=200000;
ll inv[maxn+10],jc[maxn+10], f[maxn];
pair<int ,int >p[2019];
ll power(ll a,ll b){
ll ans=1;
while(b){
if(b&1)ans=a*ans%mod;
a=a*a%mod;
b/=2;
}
return ans;
}
ll C(int n,int m){
return jc[n]*inv[m]%mod*inv[n-m]%mod;
}
int main(){
jc[0]=1,inv[0]=1;
rep(i,1,200000){
jc[i]=jc[i-1]*i%mod;
inv[i]=power(jc[i],mod-2);
}
cin>>h>>w>>n;
rep(i,1,n){
scanf("%I64d%I64d",&p[i].first,&p[i].second);
}
sort(p+1,p+n+1);
p[n+1].first=h,p[n+1].second=w;
f[0]=0;
rep(i,1,n+1){
f[i]=C(p[i].first+p[i].second-2,p[i].first-1);
rep(j,1,i-1){
if(p[j].first<=p[i].first&&p[j].second<=p[i].second){
f[i]=(f[i]-f[j]*C(p[i].first-p[j].first+p[i].second-p[j].second,p[i].first-p[j].first))%mod;
}
}
}
cout<<(f[n+1]+mod)%mod<<endl;
return 0;
}