#include <bits/stdc++.h>

using namespace std;

using LL = long long;
using PII = pair<int, int>;
using ll = long long;
using DBL = double;
using VI = vector<int>;
using VD = vector<DBL>;
using VVI = vector<VI>;
using VVD = vector<VD>;

#define FOR(i,a,b) for(int i = a; i < b; i++)
#define REP(i,n) FOR(i,0,n)
#define SZ(a) ((int)((a).size()))
#define ALL(x) (x).begin(), (x).end()
#define SET(a,v) memset((a), (v), sizeof(a))
#define EB emplace_back
#define PB push_back
#define MP make_pair
#define ST first
#define ND second

//#define trace(...) {__f(#__VA_ARGS__, __VA_ARGS__);}
//template<typename Arg> void __f(const char* name, Arg&& arg) {
//  cerr << name << " = " << arg << std::endl;
//} template <typename Arg1, typename... Args>
//void __f(const char* names, Arg1&& arg1, Args&&... args) {
//  const char* comma = strchr(names + 1, ',');
//  cerr.write(names, comma - names) << " = " << arg1<<" | ";__f(comma+1, args...); }
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds; // OST: find_by_order, order_of_key
//typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
//#pragma GCC optimize("Ofast")
//optimize("unroll-loops")
//target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
///*** RNGS ***/
//SEED=chrono::steady_clock::now().time_since_epoch().count();
//// or high_resolution_clock
//mt19937 rng(SEED); /*or*/ random_device rd; mt19937 rng(rd());
//uniform_int_distribution<> dis(MIN, MAX);// usage: dis(rng)
//struct chash {int operator()(int x) const {return x^SEED;}};
//gp_hash_table<int,int,chash>m;//use cc if very less updates
///*** FAST IO ***/
//inline int scan(){ bool y=0; int x=0; char c=getchar_unlocked();
//while(c<'0'||c>'9'){ if(c=='-')y=1; c=getchar_unlocked();}
//while(c>='0'&&c<='9'){x=(x<<1)+(x<<3)+c-'0';c=getchar_unlocked();}
//return y?-x:x; }

vector<PII> p;
const int MAXN = 200010;
const int MOD = 1000000007;
int fact[MAXN], ifact[MAXN];
PII dp[MAXN];

int C(int n, int r) {
    assert(n >= 0 and r >= 0 and r <= n);
    return (fact[n]*1ll*((ifact[r] * 1ll * ifact[n-r]) % MOD)) % MOD;
}

PII calc(int pos) {
    PII &y = dp[pos];
    if(y.first != -1) return y;
    if(pos == p.size() - 1) {
        return y = {1, 0};
    }
    y = {0, 0};
    for(int i=pos+1; i<p.size(); ++i) {
        if(p[i].first >= p[pos].first and p[i].second >= p[pos].second) {
            long long mul = C(p[i].first - p[pos].first + p[i].second - p[pos].second, p[i].second - p[pos].second);
            auto temp = calc(i);
            y.first = (y.first + mul*temp.second) % MOD;
            y.second = (y.second + mul*temp.first) % MOD;
        }
    }
    return y;
}

int modpow(int a, int b) {
    if(b == 0) return 1;
    if(b&1) {
        return (modpow(a, b-1) * 1ll * a) % MOD;
    }
    return modpow((a*1ll*a)%MOD, b/2);
}

int main() {
    #ifdef LOCAL_EXEC
//    freopen("sample.in", "r", stdin);
//    freopen("sample.out", "w", stdout);
    #else
    ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
    #endif
    memset(dp, -1, sizeof(dp));
    int h, w, n;
    cin >> h >> w >> n;
    for(int i=1; i<=n; ++i) {
        PII temp;
        cin >> temp.first >> temp.second;
        p.PB(temp);
    }
    fact[0] = 1;
    for(int i=1; i<MAXN; ++i) {
        fact[i] = (i * 1ll * fact[i-1]) % MOD;
    }
    for(int i=0; i<MAXN; ++i) {
        ifact[i] = modpow(fact[i], MOD-2);
    }
    p.PB({1, 1});
    p.PB({h, w});
    sort(ALL(p), [](const auto&a, const auto&b) {
        return a.first + a.second < b.first + b.second;
    });
    assert(p[0] == MP(1, 1));
    assert(p.back() == MP(h, w));
    PII temp = calc(0);
    int ans = temp.second - temp.first;
    if(ans < 0) ans += MOD;
    cout << ans << endl;
	return 0;
}


Measured memory_bytes: 7048