#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define rrep(i,n) for(int i=(int)n-1;i>=0;--i)
using namespace std;
using ll = long long;
template<typename T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<typename T> inline bool chmin(T& a,T b){if(b<a){a=b;return 1;}return 0;}
template<typename T> vector<T> make_vec(size_t a){return vector<T>(a);}
template<typename T,typename... Ts>
auto make_vec(size_t a,Ts... ts){return vector<decltype(make_vec<T>(ts...))>(a,make_vec<T>(ts...));}
template<typename T,typename U,typename... V>
typename enable_if<is_same<T,U>::value>::type fill_v(U& u,const V... v){u=U(v...);}
template<typename T,typename U,typename... V>
typename enable_if<!is_same<T,U>::value>::type fill_v(U& u,const V... v){for(auto& e:u)fill_v<T>(e,v...);}

const int mod = 1000000007;

struct mint {
    long long x;
    mint(long long x=0) : x((x % mod + mod) % mod) {}
    mint operator-() const { return mint(-x);}
    mint& operator+=(const mint a) {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator-=(const mint a) {
        if ((x += mod - a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
    mint operator+(const mint a) const { return mint(*this) += a;}
    mint operator-(const mint a) const { return mint(*this) -= a;}
    mint operator*(const mint a) const { return mint(*this) *= a;}
    mint pow(long long t) const {
        if (!t) return 1;
        mint a = pow(t>>1);
        a *= a;
        if (t&1) a *= *this;
        return a;
    }
    mint inv() const { return pow(mod-2);}
    mint& operator/=(const mint a) { return *this *= a.inv();}
    mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}

struct combination {
    vector<mint> fact, ifact;
    combination(int n) : fact(n+1), ifact(n+1) {
        assert(n < mod);
        fact[0] = 1;
        for (int i = 1; i <= n; ++i) fact[i] = fact[i-1] * i;
        ifact[n] = fact[n].inv();
        for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i] * i;
    }
    mint operator()(int n, int k) {
        if (k < 0 || k > n) return 0;
        return fact[n] * ifact[k] * ifact[n-k];
    }
    mint p(int n, int k) { return fact[n] * ifact[n-k];}
} comb(2e5);

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int h, w, n;
    cin >> h >> w >> n;
    vector<pair<int, int>> rc(n);
    rep(i, n) cin >> rc[i].first >> rc[i].second;
    rep(i, n) rc[i].first--, rc[i].second--;
    sort(rc.begin(), rc.end());
    
    // dp[0]はstart, dp[1]〜dp[n]が壁、dp[n+1]がgoal
    auto dp = make_vec<mint>(n+2, 2);
    
    dp[0][0] = 1;

    rep(i, n) {
        auto [r, c] = rc[i];
        dp[i+1][1] += comb(r + c, r);
        for (int j = 0; j < i; ++j) {
            auto [y, x] = rc[j];
            if (x <= c) {
                dp[i+1][0] += dp[j+1][1] * comb((r-y) + (c-x), r-y);
                dp[i+1][1] += dp[j+1][0] * comb((r-y) + (c-x), r-y);
            }
        }
    }

    dp[n+1][0] += comb(h+w-2, h-1);
    rep(j, n) {
        auto [y, x] = rc[j];
        dp[n+1][0] += dp[j+1][0] * comb((h-1-y) + (w-1-x), h-1-y);
        dp[n+1][1] += dp[j+1][1] * comb((h-1-y) + (w-1-x), h-1-y);
    }
    cout << dp[n+1][0] - dp[n+1][1] << endl;
}


Measured memory_bytes: 6716