// #define _GLIBCXX_DEBUG // for STL debug (optional)
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;

#define debug(...) fprintf(stderr, __VA_ARGS__)
#define int long long int
 
template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
 
typedef pair<int, int> pii;
typedef long long ll;
 
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const ll INF = 1001001001001001LL;
const ll MOD = 1000000007LL;

int dp[2][3010], tmp[3][3010], pre[3010][3010];

const int MAXF = 200010;
int fact[MAXF + 10], finv[MAXF + 10];
int H, W, N;

int mod_pow(int x, int k) {
    int res = 1;
    for(; k>0; k>>=1) {
        if(k & 1) (res *= x) %= MOD;
        (x *= x) %= MOD;
    }
    return res;
}

int comb(int n, int r) {
    if(r < 0 or n < r) return 0;
    return fact[n] * finv[n-r] % MOD * finv[r] % MOD;
}

int calc(int r, int c) {
    int valL = comb(r+c, r);
    int valR = comb(H+W-2-r-c, H-r-1);
    // fprintf(stderr, "r = %lld, c = %lld, valL = %lld, valR = %lld\n", r, c, valL, valR);
    return valL * valR % MOD;
}

signed main() {
    cin >> H >> W >> N;
    vector< pair<int, int> > rc(N);
    for(int i=0; i<N; i++) {
        int r, c; cin >> r >> c; r--; c--;
        rc[i] = make_pair(r, c);
    }
    sort(rc.begin(), rc.end());

    vector<int> r(N), c(N);
    for(int i=0; i<N; i++) {
        tie(r[i], c[i]) = rc[i];
    }

    fact[0] = 1;
    for(int i=1; i<=MAXF; i++) {
        fact[i] = (fact[i-1] * i) % MOD;
    }
    finv[MAXF] = mod_pow(fact[MAXF], MOD-2);
    for(int i=MAXF-1; i>=0; i--) {
        finv[i] = (finv[i+1] * (i+1)) % MOD;
    }

    for(int j=0; j<N; j++) {
        for(int i=0; i<j; i++) {
            if(r[i] <= r[j] and c[i] <= c[j]) {
                /*
                int diff_x = r[j] - r[i];
                int diff_y = c[j] - c[i];

                int rem_x = H - 1 - r[j]; 
                int rem_y = W - 1 - c[j]; 
                
                int combA = comb(r[i] + c[i], r[i]);
                int combB = comb(diff_x + diff_y, diff_x);
                int combC = comb(rem_x + rem_y, rem_x);

                pre[i][j] = combA * combB % MOD * combC % MOD;
                fprintf(stderr, "combA = %lld, combB = %lld, combC = %lld\n", combA, combB, combC);
                */

                int diff_x = r[j] - r[i];
                int diff_y = c[j] - c[i];
                pre[i][j] = comb(diff_x + diff_y, diff_x);
                // fprintf(stderr, "pre[%lld][%lld] = %lld\n", i, j, pre[i][j]);
            }
        }
    }

    // 個数の偶奇、最後に取ったところ
    for(int i=0; i<N; i++) {
        // i 番目を取る

        // 新しく取るやつ
        dp[1][i] += comb(r[i] + c[i], c[i]);
        
        for(int j=0; j<i; j++) {
            // 前のやつから引き継ぎ
            (dp[1][i] += dp[0][j] * pre[j][i]) %= MOD;
            (dp[0][i] += dp[1][j] * pre[j][i]) %= MOD;
        }

        // fprintf(stderr, "dp[0][%lld] = %lld, dp[1][%lld] = %lld\n", i, dp[0][i], i, dp[1][i]);
        
        // i 番目を取らない (変わらない)
    }
    
    int ans = comb(H+W-2, H-1);
    for(int i=0; i<N; i++) {
        int rx = H - 1 - r[i], ry = W - 1 - c[i];
        int mul = comb(rx + ry, rx);

        int res0 = (dp[0][i] * mul) % MOD;
        int res1 = (dp[1][i] * mul) % MOD;
        (ans += res0) %= MOD;
         ans = (ans - res1 + MOD) % MOD;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 74112