#include <bits/stdc++.h>
#define ll long long int
#define ld long double
const ll MOD = 1e9 + 7;
const ll INF = 1e18;
using namespace std;

vector<string> vec_splitter(string s) {
    s += ',';
    vector<string> res;
    while(!s.empty()) {
        res.push_back(s.substr(0, s.find(',')));
        s = s.substr(s.find(',') + 1);
    }
    return res;
}
void debug_out(
vector<string> __attribute__ ((unused)) args,
__attribute__ ((unused)) int idx, 
__attribute__ ((unused)) int LINE_NUM) { cerr << endl; } 
template <typename Head, typename... Tail>
void debug_out(vector<string> args, int idx, int LINE_NUM, Head H, Tail... T) {
    if(idx > 0) cerr << ", "; else cerr << "Line(" << LINE_NUM << ") ";
    stringstream ss; ss << H;
    cerr << args[idx] << " = " << ss.str();
    debug_out(args, idx + 1, LINE_NUM, T...);
}
#ifdef XOX
#define deb(...) debug_out(vec_splitter(#__VA_ARGS__), 0, __LINE__, __VA_ARGS__)
#else
#define deb(...) 42
#endif

struct mint {
  ll x;
  mint():x(0){}
  mint(ll x):x((x%MOD+MOD)%MOD){}
  // mint(ll x):x(x){}
  mint& fix() { x = (x%MOD+MOD)%MOD; return *this;}
  mint operator-() const { return mint(0) - *this;}
  mint operator~() const { return mint(1) / *this;}
  mint& operator+=(const mint& a){ if((x+=a.x)>=MOD) x-=MOD; return *this;}
  mint& operator+=(const int& a){ if((x+=a)>=MOD) x-=MOD; return *this;}
  mint& operator+=(const ll& a){ if((x+=a)>=MOD) x-=MOD; return *this;}
  mint& operator-=(const mint& a){ if((x+=MOD-a.x)>=MOD) x-=MOD; return *this;}
  mint& operator-=(const ll& a){ if((x+=MOD-a)>=MOD) x-=MOD; return *this;}
  mint& operator-=(const int& a){ if((x+=MOD-a)>=MOD) x-=MOD; return *this;}
  mint& operator*=(const mint& a){ (x*=a.x)%=MOD; return *this;}
  mint& operator*=(const ll& a){ (x*=a)%=MOD; return *this;}
  mint& operator*=(const int& a){ (x*=a)%=MOD; return *this;}
  mint& operator/=(const mint& a){ (x*=a.ex(MOD-2).x)%=MOD; return *this;}
  mint operator+(const mint& a)const{ return mint(*this) += a;}
  mint operator+(const ll& a)const{ return mint(*this) += mint(a);}
  mint operator+(const int& a)const{ return mint(*this) += mint(a);}
  mint operator-(const mint& a)const{ return mint(*this) -= a;}
  mint operator-(const ll& a)const{ return mint(*this) -= mint(a);}
  mint operator-(const int& a)const{ return mint(*this) -= mint(a);}
  mint operator*(const mint& a)const{ return mint(*this) *= a;}
  mint operator*(const ll& a)const{ return mint(*this) *= mint(a);}
  mint operator*(const int& a)const{ return mint(*this) *= mint(a);}
  mint operator/(const mint& a)const{ return mint(*this) /= a;}
  mint operator/(const ll& a)const{ return mint(*this) /= mint(a);}
  mint operator/(const int& a)const{ return mint(*this) /= mint(a);}
  mint& operator=(const ll&a){ this->x = a; return (*this);}
  mint& operator=(const int&a){ this->x = a; return (*this);}
  mint ex(ll t) const {
    if(!t) return 1;
    mint res = ex(t/2);
    res *= res;
    return (t&1)?res*x:res;
  }
  bool operator<(const mint& a)const{ return x < a.x;}
  bool operator==(const mint& a)const{ return x == a.x;}
  bool operator!=(const mint& a)const{ return x != a.x;}
};

mint ex(mint x, ll t) { return x.ex(t);}
mint operator/(ll a, mint b)    {   return mint(a) / b; }
mint operator*(ll a, mint b)    {   return mint(a) * b; }
mint operator+(ll a, mint b)    {   return mint(a) + b; }
mint operator-(ll a, mint b)    {   return mint(a) - b; }
istream& operator>>(istream&i,mint&a){i>>a.x;return i;}
ostream& operator<<(ostream&o,const mint&a){o<<a.x % MOD;return o;}

const int MN = 1000003;
mint fact[MN], revfact[MN];
void calc(){
    fact[0] = 1;
    revfact[0] = 1;
    for(ll i = 1; i < MN; i++)  fact[i] = (fact[i - 1] * i), revfact[i] = 1ll / fact[i];
}

mint C(ll n, ll r){
    if(n < r)   return 0ll;
    mint res = fact[n];
    res *= revfact[r];
    res *= revfact[n - r];
    return res;
}

mint path(ll a, ll b, ll x, ll y){
    ll tmp = abs(a - x) + abs(y - b );
    return C(tmp, abs(x - a));
}

main(){    
    #ifdef XOX
        freopen("D:\\V S Code\\cpp\\competitiveProgramming\\Input.txt", "r", stdin);
        freopen("D:\\V S Code\\cpp\\competitiveProgramming\\OPT.txt", "w", stdout);
    #endif

    ios::sync_with_stdio(!cin.tie(NULL));
    
    ll h, w;

    calc();

    int n;
    cin >> h >> w >> n;

    mint res = 0;
    ll x[n + 10], y[n + 10];
    x[n + 1] = h, y[n + 1] = w;
    mint dp[n + 10];
    x[0] = y[0] = 0;
    int ind[n + 3];
    ind[n] = n + 1;
    for(int i = 0; i < n; i++)  ind[i] = i + 1;
    for(int i = 1; i <= n; i++){
        cin >> x[i] >> y[i];

    }

    sort(ind, ind + n, [&](int a, int b) {
        return x[a] < x[b] or (x[a] == x[b] and y[a] < y[b]);
    });



    for(int i = 0; i < n + 1; i++){
        int cur = ind[i];
        dp[i] = path(1, 1, x[cur], y[cur]);


        for(int j = 0; j < i; j++){
            if(y[ind[j]] <= y[cur])
                dp[i] -= dp[j] * path(x[ind[j]], y[ind[j]], x[cur], y[cur]);
        }

    }


    cout << dp[n];

}

Measured memory_bytes: 16000