#include <bits/stdc++.h>

using namespace std;

typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
//#define int ll
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector< vi > vvi;
typedef vector< vvi > vvvi;
typedef vector<short> vs;
typedef vector<vs> vvs;
typedef vector<vvs> vvvs;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vvl> vvvl;
typedef vector<ld> vld;
typedef vector<vld> vvld;
typedef vector<vvld> vvvld;
typedef vector<string> vst;
typedef vector<vst> vvst;
typedef pair<ld, ld> pld;
typedef complex<double> base;

#define inmin(a, b) a = min(a, (b))
#define inmax(a, b) a = max(a, (b))
#define mp(a,b) make_pair(a,b)
#define modsum(a, b) ((a) + (b) >= M ? (a) + (b) - M : (a) + (b))
#define modsubtract(a, b) ((a) - (b) < 0 ? (a) - (b) + M : (a) - (b))
#define modmultiply(a, b) (((a) * (b)) % M)
#define ALL(a) a.begin(),a.end()
#define RALL(a) a.rbegin(),a.rend()
#define sqr(x) ((x) * (x))
#define fori(i, n) for(int i = 0; i < int(n); ++i)
#define cint const int &
#define SZ(a) ((int)((a).size()))
#define watch(x) cout << (#x) << " = " << (x) << endl;

const double PI = 2 * acos(0.0);

const string DIGITS = "0123456789";
const string ALPH = "abcdefghijklmnopqrstuvwxyz";


template<class T>
inline ostream & operator << (ostream &out, vector<T> &a) {
    out << "{";
    fori (i, SZ(a))
        out << a[i] << vector<string>{", ", "}"}[i + 1 == SZ(a)];
    return out;
}

void smain();

signed main() {
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);


#ifdef MAX_HOME
    freopen("input.txt", "r", stdin);
    clock_t start = clock();
#define cerr cout
#else
#define cerr if (0) cerr
#endif
    cout << setprecision(12) << fixed;
    smain();
#ifdef MAX_HOME
    cout << "\n\n\n\n";
    cout << "TOTAL EXECUTION TIME: " << float( clock () - start ) /  CLOCKS_PER_SEC << endl;
#endif
}

const int N = 2e5 + 9;
const ll M  = 1e9 + 7;
ll dp[N];

inline ll pw(ll a, ll p) {
    ll ret = 1;
    while (p) {
        if (p & 1) ret = ret * a % M;
        a = a * a % M;
        p >>= 1;
    }
    return ret;
}

ll fact[N];
ll inv[N];

void init() {
    fact[0] = inv[0] = 1;
    for (int i = 1; i < N; ++i) {
        fact[i] = fact[i - 1] * i % M;
        inv[i] = pw(fact[i], M - 2);
    }
}

inline ll nCr(int n, int k) {
    return fact[n] * inv[k] % M * inv[n - k] % M;
}

inline ll get_dist(pii a, pii b) {
    return nCr(b.first + b.second - a.first - a.second, b.second - a.second);
}

inline bool is_shadow(pii a, pii b) {
    return a.first <= b.first && a.second <= b.second;
}

void smain() {

    init();

    int h, w;
    int n;
    cin >> h >> w >> n;
    vector<pii> obj(n + 1);
    fori (i, n) {
        cin >> obj[i].first >> obj[i].second;
        obj[i].first--, obj[i].second--;
    }
    obj[n] = {h - 1, w - 1};
    sort(ALL(obj));
    for (int i = 0; i <= n; ++i) {
        dp[i] = get_dist({0, 0}, obj[i]);

        for (int j = 0; j < i; ++j) if (is_shadow(obj[j], obj[i])) {
            ll kek = dp[j] * get_dist(obj[j], obj[i]) % M;
            dp[i] = (dp[i] + M - kek) % M;
        }
        cerr << "dp[" << i << "] = " << dp[i] << endl;
        cerr << obj[i].first << ", " << obj[i].second << endl;
    }
    cout << dp[n];
}

Measured memory_bytes: 4352