#include<iostream>
#include<vector>
#include<algorithm>
#include<unordered_set>
#include<set>
#include<map>
#include<unordered_map>
#include<stack>
#include<queue>
#include<string>
#include<cmath>
#include<climits>
using namespace std;

typedef long long ll;
const int mod = 1e9+7;
const int max_ = 2*1e5 + 10;
const int maxk = 3010;

vector<pair<int,int>> walls;
ll factorial[max_], inv_factorial[max_];

ll power(ll x, ll y) {
    if(y==0)    return 1;
    if(y&1) 
        return (x*power(x,y-1)) % mod;
    ll temp = power(x,y/2);
    return (temp*temp) % mod;
}

ll binomial(ll n, ll r) {
    ll bi = ((factorial[n] * inv_factorial[r] % mod) * inv_factorial[n-r]) % mod;
    return bi;
}
int main() {
    int h,w,n,x,y;
    cin>>h>>w>>n;
    
    for(int i=0;i<n;i++) {
        cin>>x>>y;
        walls.push_back({x,y});
    }
    sort(walls.begin(),walls.end());
    walls.push_back({h,w});

    factorial[0]=1; inv_factorial[0]=1;
    // vector<ll> factorial(max_,1), inv_factorial(max_,1);
    for(int i=1;i<max_;i++) {
        factorial[i] = i*factorial[i-1] % mod;
        inv_factorial[i] = power(factorial[i], mod-2);
    }
    // cout<<binomial(1,1);
    // for(int i=0;i<h+w;i++)
    //     cout<<factorial[i]<<"   "<<inv_factorial[i]<<endl;
    vector<ll> dp(n+1,0);
    for(int i=0;i<=n;i++) 
        dp[i] = binomial(walls[i].first + walls[i].second -2, walls[i].first -1);

    for(int i=0;i<n;i++) {
        for(int j=i+1;j<=n;j++) {
            if(walls[j].first < walls[i].first || walls[j].second < walls[i].second)
                continue;
            dp[j] -= (dp[i] * binomial(walls[j].first-walls[i].first + walls[j].second-walls[i].second, walls[j].first-walls[i].first))%mod;
            dp[j] = dp[j]%mod;
        }
    }
    if(dp[n]<0)     dp[n] += mod;
    cout<<dp[n];
}


// #include <bits/stdc++.h>
// using namespace std;

// typedef pair<int,int> ii;
// typedef long long ll;

// const int MAXN = 2*1e5 + 10;
// const int MAXK = 3010;
// const int MOD = 1e9 + 7;

// vector<ii> pontos;
// ll fatorial[MAXN],invfatorial[MAXN],qnts[MAXK];
// int H,W,N;

// ll fast_expo(ll x,int y){
// 	if(y == 0) return 1;
// 	if(y & 1) return (x*fast_expo(x,y-1)) % MOD;
// 	ll temp = fast_expo(x,y/2);
// 	return (temp*temp) % MOD;
// }

// ll binomial(ll n,ll k){
// 	return ((fatorial[n]*invfatorial[k] % MOD)*invfatorial[n - k]) % MOD;
// }

// int main(){

// 	fatorial[0] = invfatorial[0] = 1;
// 	for(int i = 1;i<MAXN;i++){
// 		fatorial[i] = (fatorial[i-1]*i) % MOD;
// 		invfatorial[i] = fast_expo(fatorial[i],MOD - 2);
// 	}

// 	cin >> H >> W >> N;
// 	pontos.push_back(ii(H,W));

// 	for(int i = 0;i<N;i++){
// 		int x,y;
// 		cin >> x >> y;
// 		pontos.push_back(ii(x,y));
// 	}

// 	sort(pontos.begin(),pontos.end());

// 	for(int i = 0;i<=N;i++){
// 		qnts[i] = binomial(pontos[i].first + pontos[i].second - 2, pontos[i].first - 1 );
// 	}

// 	for(int i = 0;i<N;i++){
// 		for(int j = i+1;j<=N;j++){
// 			int deltax = pontos[j].first - pontos[i].first;
// 			int deltay = pontos[j].second - pontos[i].second;
// 			if(deltax < 0 || deltay < 0) continue;
// 			qnts[j] -= binomial(deltax+deltay,deltay)*qnts[i];
// 			qnts[j] %= MOD;
// 		}
// 	}

// 	if(qnts[N] < 0) qnts[N] += MOD;
// 	cout << qnts[N] << endl;

// 	return 0;

// }

Measured memory_bytes: 6800