// Vivek Rai
// Blazer_007

#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse2")

#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//#include <ext/pb_ds/detail/standard_policies.hpp>

#define fastio 		ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define mp	         make_pair
#define inf         0x3f3f3f3f
//#define INF         0x3f3f3f3f3f3f3f3fLL
#define ll          long long
#define pb          push_back
#define pii         pair<ll,ll>
#define vi          vector<ll>
#define vii         vector<pii>
#define mi          map<ll,ll>
#define mii         map<pii,ll>
#define ppi	        pair<ll,pii>
#define all(a)      (a).begin(),(a).end()
#define FF           first
#define SS           second
#define sz(x)       (int)x.size()
#define endl        '\n'
#define hell        1000000007
#define see(x)	    cout<<x<<endl;
#define see2(x,y)   cout<<x<<" "<<y<<endl;
#define see3(x,y,z) cout<<x<<" "<<y<<" "<<z<<endl;
#define bit(x, y)   (((x)>>(y))&1)
#define bpt(x)      (__builtin_popcount(x))
#define bptl(x)     (__builtin_popcountll(x))
#define loop(i,a,b)  for(int i=a;i<b;i++)
#define rloop(i,a,b) for(int i=a;i>=b;i--)
#define N 2000010

using namespace std;
//using namespace __gnu_pbds;

//typedef priority_queue<int> maxHeap;
//typedef priority_queue<int,vector<int>,greater<int>()) minHeap;
//typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
// find_by_order(index) -> value at given index or Kth smallest element in set
// order_of_key(X) -> number of elements strictly less than X
//typedef tree<pii , null_type, less<pii>, rb_tree_tag, tree_order_statistics_node_update> OST;

#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1){
        cout << name << " : " << arg1 << endl;
        //use cerr if u want to display at the bottom
    }
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){
        const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
    }
#else
#define trace(...)
#endif

//nCr calculation code 

#define MOD 1000000007
#define MAX 2000012

ll fact[MAX], invFact[MAX];
void pre(){
    fact[0] = invFact[0] = invFact[1] = 1;
    int i;
    for(i=1;i<MAX;i++) fact[i] = (fact[i-1]*i)%MOD;
    for(i=2;i<MAX;i++) invFact[i] = (MOD - MOD/i) * invFact[MOD % i] % MOD;
    for(i=1;i<MAX;i++) invFact[i] = (invFact[i-1] * invFact[i])%MOD;
}
ll nCr(ll n, ll r){
    return (((fact[n]*invFact[r])%MOD)*invFact[n-r])%MOD;
}

bool cmp(pii& p1, pii& p2){
    return ( (p1.FF + p1.SS) < (p2.FF + p2.SS)) ;
}

ll pathsBetweenPts(pii p1, pii p2){
    if(p1.FF <= p2.FF && p1.SS <= p2.SS){
        ll down = p2.FF - p1.FF ;
        ll right = p2.SS - p1.SS ;
        return nCr(down + right,down) ;
    }
    return 0;
}

ll solve(ll H, ll W, vii obs){
    ll ways = nCr(H+W-2, H-1);
    sort(all(obs),cmp);
    vi pathsToObs;
    pathsToObs.pb(pathsBetweenPts({1,1},obs[0]));
    loop(i,1,sz(obs)){
        ll paths = pathsBetweenPts({1,1},obs[i]);
        rloop(j,i-1,0){
            paths = (paths - (pathsToObs[j] * pathsBetweenPts(obs[j] , obs[i])) % hell + hell) % hell ;
        }
        pathsToObs.pb(paths);
    }
    loop(i,0,sz(obs)){
        ways = (ways - (pathsToObs[i] * pathsBetweenPts(obs[i],{H,W})) % hell + hell ) % hell ;        
    }
    return ways;
}

void solution(){
    ll H,W,n;
    cin >> H >> W >> n;
    vii obs(n);
    loop(i,0,n)
        cin >> obs[i].FF >> obs[i].SS ;
    cout << solve(H,W,obs) << endl;
}

signed main(){
    fastio
    // #ifndef ONLINE_JUDGE
    // 	freopen("input.txt", "r" , stdin);
    // 	freopen("output.txt", "w", stdout);
    // #endif

    ll t=1;
    // cin>>t;
    pre();
    loop(i,1,t+1){
    	//cout<<"Case #"<<i<<": ";
    	solution();
    }
}




Measured memory_bytes: 31616