#include <bits/stdc++.h>
using namespace std;
#define all(x) x.begin(),x.end()
#define db(...) " [" << #__VA_ARGS__ << ": " << __VA_ARGS__ << "] "
using ii=long long;
const ii mod = 1e9 + 7;
const int N = 1 << 18;
ii fact[N];
ii mpow(ii x, ii y)
{
    if (y == 1) return x;
    if (y % 2) return mpow(x, y - 1) * x % mod;
    ii z = mpow(x, y / 2);
    return z * z % mod;
}
ii inv(ii x)
{
    return mpow(x % mod, mod - 2);
}
ii binom(ii x, ii y)
{
    ii z = fact[x];
    z *= inv(fact[y] * fact[x - y]);
    return z % mod;
}
ii ways(ii x, ii y)
{
    return binom(x + y - 2, y - 1);
}
int main()
{
    fact[0] = 1;
    for (int i = 1; i < N; ++i) {
        fact[i] = fact[i - 1] * i;
        fact[i] %= mod;
    }
    int n, m, k;
    cin >> n >> m >> k;
    vector<pair<int, int>> v(k);
    for (int i = 0; i < k; ++i) {
        cin >> v[i].first >> v[i].second;
    }
    v.emplace_back(n, m);
    sort(all(v));
    vector<ii> res(v.size());
    for (int i = 0; i < (int) v.size(); ++i) {
        res[i] = ways(v[i].first, v[i].second);
        for (int j = 0; j < (int) v.size(); ++j) {
            if (v[i].first < v[j].first || v[i].second < v[j].second || i == j) continue;
            int yd = v[i].first - v[j].first + 1;
            int xd = v[i].second - v[j].second + 1;
            res[i] -= (res[j] * ways(yd, xd)) % mod;
            if (res[i] < 0) res[i] += mod;
        }
    }
    cout << res.back() << "\n";
}
