#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int SIZE = 2 * 1e5 + 3;
const ll MOD = 1e9 + 7;
array<ll, SIZE> fact;
void init() {
  fact[0] = 1;
  for (int i = 1; i < SIZE; i++) {
    fact[i] = (fact[i - 1] * i) % MOD;
  }
}
ll powm(ll x, ll k) {
  ll res = 1;
  while (k) {
    if (k & 1) res = (res * x) % MOD;
    x = (x * x) % MOD;
    k >>= 1;
  }
  return res;
}
ll inv(ll x) { return powm(x, MOD - 2); }
ll comb(ll n, ll k) {
  return ((fact[n] * inv(fact[k])) % MOD * inv(fact[n - k])) % MOD;
}
int main() {
  init();
  ll h, w;
  int n;
  cin >> h >> w >> n;
  vector<pair<int, int>> hw(n + 1);
  for (int i = 0; i < n; i++) {
    cin >> hw[i].first >> hw[i].second;
    hw[i].first--, hw[i].second--;
  }
  hw[n] = {int(h - 1), int(w - 1)};
  sort(hw.begin(), hw.end());
  vector<ll> dp(n + 1, 0);
  for (int i = 0; i <= n; i++) {
    dp[i] = comb(hw[i].first + hw[i].second, hw[i].first);
    for (int j = 0; j < i; j++) {
      if (hw[j].first <= hw[i].first && hw[j].second <= hw[i].second) {
        dp[i] -= (dp[j] *
                  comb(hw[i].first - hw[j].first + hw[i].second - hw[j].second,
                       hw[i].first - hw[j].first)) %
                 MOD;
        dp[i] = (dp[i] % MOD + MOD) % MOD;
      }
    }
  }
  cout << dp[n] << endl;
  return 0;
}
