#include <bits/stdc++.h>
using namespace std;
#define finish(x) reutrn cout << x << endl, 0;
#define ll long long

int h, w, n, x, y, dp[3005], fact[200001], inv[200001], mod = 1e9 + 7;
vector <pair <int, int> > a;

int powlog(int a, int b){
    if(b == 0) return 1;
    int ret = powlog(a, b / 2);
    if(b % 2) return 1LL * ret * ret % mod * a % mod;
    return 1LL * ret * ret % mod;
}
int C(int n, int r){
    return 1LL * fact[n] * inv[r] % mod * inv[n - r] % mod;
}
int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    fact[0] = 1;
    inv[0] = 1;
    for(int i = 1 ; i <= 200000 ; i++){
        fact[i] = 1LL * i * fact[i - 1] % mod;
        inv[i] = powlog(fact[i], mod - 2);
    }
    cin >> h >> w >> n;
    for(int i = 0 ; i < n && cin >> x >> y ; i++)
        a.push_back(make_pair(x, y));
    a.push_back(make_pair(h, w));
    sort(a.begin(), a.end());
    for(int i = 0 ; i < a.size() ; i++){
        dp[i] = C(a[i].first + a[i].second - 2, a[i].first - 1);
        for(int j = 0 ; j < i ; j++)
            if(a[j].second <= a[i].second)
                dp[i] = (dp[i] - 1LL * C(a[i].first - a[j].first + a[i].second - a[j].second, a[i].first - a[j].first) * dp[j] % mod + mod) % mod;
    }
    cout << dp[n] << endl;
}
