#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD=1e9+7;
const int INF=1e9;
const ll LINF=(ll)1e18;

struct Combination{
    vector<ll> fac,finv,inv;
    Combination(int mx){init(mx);}
    void init(int mx){
        fac.resize(mx+1);
        finv.resize(mx+1);
        inv.resize(mx+1);
        fac[0]=fac[1]=1;
        finv[0]=finv[1]=1;
        inv[1]=1;
        for(int i=2;i<=mx;i++){
            fac[i]=fac[i-1]*i%MOD;
            inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD;
            finv[i]=finv[i-1]*inv[i]%MOD;
        }
    }
    ll calc(int n,int k){
        return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD;
    }
};

ll dp[3001];

int main(){
    int h,w,n;
    cin>>h>>w>>n;
    pair<int,int> p[n+1];
    for(int i=0;i<n;i++){
        int r,c;
        cin>>r>>c;
        p[i]={r,c};
    }
    p[n]={h,w};
    sort(p,p+n+1);
    Combination comb(200000);
    dp[0]=1;
    for(int i=0;i<n+1;i++){
        int ri=p[i].first;
        int ci=p[i].second;
        dp[i]=comb.calc(ri+ci-2,ri-1);
        for(int j=0;j<i;j++){
            int rj=p[j].first;
            int cj=p[j].second;
            if(rj<=ri&&cj<=ci){
                ll t=comb.calc(ri-rj+ci-cj,ri-rj);
                dp[i]-=(dp[j]*t)%MOD;
            }
        }
        dp[i]=(dp[i]%MOD+MOD)%MOD;
    }
    cout<<dp[n]<<endl;
}