#include <bits/stdc++.h>
#ifdef ONLINE_JUDGE
#define endl "\n"
#endif
using namespace std;
typedef unsigned long long int lu;
typedef long long int ll;
typedef long double ld;
typedef vector<ll> v;
typedef vector<lu> vu;
typedef vector<v> vv;
typedef vector<vu> vvu;
typedef vector<ld> vld;
typedef vector<bool> vb;
typedef vector<string> vs;
typedef pair<ll, ll> pll;
typedef vector<set<ll>> vsll;
typedef set<pair<ll, ll>> spll;
typedef vector<spll> vspll;
typedef vector<pll> vpll;
typedef pair<lu, lu> puu;
typedef vector<puu> vpuu;
const ll MOD = 1e9 + 7;
const ld PI = 2 * acos(0.0);
const v dx = {1, -1, 0, 0};
const v dy = {0, 0, 1, -1};
#define round(x, y) ((x + y - 1) / y)
#define ce(x, y) ((x + y - 1) / y)
#define amax(x, y) \
    if (y > x)     \
        x = y;
#define amin(x, y) \
    if (y < x)     \
        x = y;
#define lcm(x, y) ((x) * (y) / __gcd(x, y))
#define sz(x) (ll) x.size()
#define sq(x) ((x) * (x))
#define cb(x) ((x) * (x) * (x))
#define yes cout << "YES\n";
#define no cout << "NO\n";
#define yesno(f) \
    if (f)       \
        yes else no;
#define noo \
    { no return; }

#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()

template <typename T = ll>
vector<T> ga(ll n, bool oneIndexed = false) {
    vector<T> a = vector<T>(n + oneIndexed);

    for (ll i = 0; i < n; i++) {
        T p;
        cin >> p;
        a[i + oneIndexed] = p;
    }

    return move(a);
}

template <typename T, typename A>
void pa(vector<T, A> const &a, ll begin = 0, ll end = -1) {
    if (end == -1)
        end = sz(a) - 1;
    for (ll i = begin; i <= end; i++) {
        cout << a[i] << " ";
    }
    cout << endl;
}

template <typename T>
T po(T base, T exp) {
    T result = 1;
    for (;;) {
        if (exp & 1)
            result *= base;
        exp >>= 1;
        if (!exp)
            break;
        base *= base;
    }

    return result;
}

template <typename T>
T pomod(T x, T y, T mod) {
    T res = 1;
    x = x % mod;

    while (y > 0) {
        if (y & 1)
            res = (res * x) % mod;
        y = y >> 1;
        x = (x * x) % mod;
    }
    return res;
}

ll divmod(ll a, ll b) {
    return (a * pomod(b, MOD - 2, MOD)) % MOD;
}

void solve() {
    ll h, w, n;
    cin >> h >> w >> n;
    vpll points(n + 2);
    for (ll i = 0; i < n; i++) {
        cin >> points[i + 1].first >> points[i + 1].second;
    }
    v facts(3e5 + 1, 0);
    facts[0] = 1;
    for (ll i = 1; i <= 3e5; i++) {
        facts[i] = facts[i - 1] * i;
        facts[i] %= MOD;
    }
    points[n + 1].first = h;
    points[n + 1].second = w;
    points[0].first = 1;
    points[0].second = 1;
    sort(all(points));

    // need to find dp[n+1]
    // where dp[i] is the number of ways to get from
    // point 0 to point i without touching any intermediate points
    v dp(n + 2, 0);
    dp[0] = 1;

    for (ll pos = 1; pos <= n + 1; pos++) {
        ll x = points[pos].first, y = points[pos].second;
        ll total =
            divmod(facts[x + y - 2], (facts[x - 1] * facts[y - 1]) % MOD);

        for (ll pos2 = 1; pos2 < pos; pos2++) {
            ll x2 = points[pos2].first, y2 = points[pos2].second;
            if (x2 > x || y2 > y) {
                continue;
            }
            ll dx = x - x2, dy = y - y2;
            total -= (dp[pos2] *
                      divmod(facts[dx + dy], (facts[dx] * facts[dy]) % MOD)) %
                     MOD;
            total += MOD;
            total %= MOD;
        }

        dp[pos] = total;
    }

    cout << dp[n + 1];
}

int main(void) {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    // freopen("file", "r", stdin);
    // freopen("file", "w", stdout);
    // ll t;cin >> t;while(t--)
    solve();
    return 0;
}

Measured memory_bytes: 2688