#include<bits/stdc++.h>
// Including Policy Based DS
//#include <ext/pb_ds/assoc_container.hpp>
// Including tree_order_statistics_node_update
//#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
//using namespace __gnu_pbds;

#define LL long long
#define ULL unsigned long long
LL INF=10000000000000001LL;
#define PI 2.0*acos(0.0)

typedef pair<int,int> pii;
typedef pair<LL,LL> pll;
typedef vector<int> vi;
typedef vector<LL> vl;
typedef vector<pii> vii;
typedef vector<pll> vll;

//typedef tree<
//int,
//null_type,
//less<int>,
//rb_tree_tag,
//tree_order_statistics_node_update>
//ordered_set;

#define READ 		freopen("in.txt","r",stdin)
#define WRITE  		freopen("out.txt","w",stdout)
#define BOOST		ios_base::sync_with_stdio(false);cin.tie(NULL)
#define sf 			scanf
#define pf 			printf
#define F  			first
#define S  			second
#define pb 			push_back
#define NL			pf("\n")
#define ALL(v)		v.begin(),v.end()
#define si(x)		sf("%d",&x);
#define sii(x,y)	sf("%d%d",&x,&y);
#define siii(x,y,z)	sf("%d%d%d",&x,&y,&z);
#define sl(x)		sf("%lld",&x);
#define sll(x,y)	sf("%lld%lld",&x,&y);
#define slll(x,y,z)	sf("%lld%lld%lld",&x,&y,&z);
#define clr(x,y) 	memset(x,y,sizeof (x) )
#define ch 			printf("Came Here!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n")
#define SV(v)		sort(v.begin(),v.end())
#define SVR(v,cmp)	sort(v.begin(),v.end(),cmp)
#define FOR(i,n)	for(int i=0;i<n;i++)
#define cnd			tree[idx]
#define lc			tree[idx*2]
#define rc			tree[idx*2+1]
#define lnd 		(2*idx),(b),((b+e)/2)
#define rnd 		((2*idx)+1),(((b+e)/2)+1),(e)

// graph direction array [4]
//LL X[4]={0,0,1,-1};
//LL Y[4]={1,-1,0,0};
// graph direction array [8]
//int X[8]={0,0,1,-1,-1,1,1,-1};
//int Y[8]={1,-1,0,0,-1,-1,1,1};
// Bishop direction array [8]
//int X[8]={0,0,1,-1,-1,1,1,-1};
//int Y[8]={1,-1,0,0,-1,-1,1,1};
// Knight Direction Array
//int KX[8] = {1,1,2,2,-1,-1,-2,-2};
//int KY[8] = {2,-2,1,-1,2,-2,1,-1};

bool Check(int N,int pos){return (bool)(N & (1<<pos));} // check bit
int Set(int N,int pos){	return N=N | (1<<pos);}// set bit

const LL mod=1e9+7;
LL modMul(LL a, LL b){
    LL ans = 0;
    a = a % mod;
    while (b > 0){
        if ( b % 2 )ans = (ans%mod+ a%mod) % mod;
        a = (a%mod * 2%mod) % mod;
        b /= 2;
    }
    return ans % mod;
}

LL powerMod( int a,int b ){
	if( b==0 )return 1%mod;
	LL x=powerMod( a,b/2 );
	x = ( x%mod * x%mod )%mod;
	if( b%2==1 )x = ( x%mod * a%mod )%mod;
	return x%mod;
}

LL lcm( LL a,LL b ){
	LL g = __gcd(a,b);
	return (a*b)/g;
}
const int mx = 100001;
//-------------------------------------------------------------------------------
LL fact[2*mx],inv[2*mx];
LL ncr(LL n,LL r){
    if(n<0||r<0||r>n)return 0;
    return (fact[n]%mod * ( inv[r]%mod * inv[n-r]%mod ))%mod;
}
LL calc(LL x,LL y){return ncr(x+y, y);}
vll arr;
bool cmp(pii a,pii b){return a.F+a.S < b.F+b.S;}
LL dp[3005];
int main(){
//  READ;
//  WRITE;
//	BOOST;

	LL n,x,y;
	LL h,w;
    fact[0] = inv[0] = 1;
    for(LL i=1;i<2*mx;i++){
        fact[i] = (i*fact[i-1])%mod;
        inv[i] = powerMod(fact[i],mod-2);
    }

    slll(h,w,n);
    FOR(i,n){
		sll(x,y);arr.pb(pll(x,y));
    }
    arr.pb( pll(h,w) );
    sort(arr.begin(),arr.end(),cmp);

    FOR(i,n+1){
        LL cur = calc(arr[i].F-1,arr[i].S-1);
        FOR(j,n+1){
            if( arr[i].F>=arr[j].F && arr[i].S>=arr[j].S){
				LL cc = (calc(arr[i].F-arr[j].F,arr[i].S-arr[j].S)%mod * dp[j]%mod)%mod;
				cur = (cur - cc + mod)%mod;
            }
        }

        dp[i] = cur;
    }

	pf("%lld\n",dp[n]);

    return 0;
}



Measured memory_bytes: 3456