#include <bits/stdc++.h>
using namespace std;
long long h, w, n;
vector<pair<long long, long long> > p;
long long mod = 1e9 + 7;
const long long maxn = 1e5 + 10;
long long dp[2010], jc[maxn * 2], jc_inv[maxn * 2];
long long fp(long long a, long long b) {
  long long ans = 1;
  for (; b; b >>= 1, a = a * a % mod) {
    if (b & 1) ans = ans * a % mod;
  }
  return ans;
}
long long C(long long n, long long m) {
  return jc[n] * jc_inv[m] % mod * jc_inv[n - m] % mod;
}
int main() {
  jc[0] = 1, jc_inv[0] = 1;
  for (int i = 1; i < maxn * 2; ++i) {
    jc[i] = jc[i - 1] * i % mod;
    jc_inv[i] = fp(jc[i], mod - 2);
  }
  scanf("%lld%lld%lld", &h, &w, &n);
  for (int i = 0; i < n; ++i) {
    int r, c;
    scanf("%d%d", &r, &c);
    p.push_back({r, c});
  }
  dp[0] = 1;
  p.push_back({h, w});
  std::sort(p.begin(), p.end());
  for (int i = 0; i < p.size(); ++i) {
    int xi = p[i].first, yi = p[i].second;
    dp[i + 1] = C(xi + yi - 2, xi - 1) % mod;
    for (int j = 0; j < i; ++j) {
      if (p[j].second > p[i].second) continue;
      xi = p[i].first - p[j].first, yi = p[i].second - p[j].second;
      dp[i + 1] = (dp[i + 1] - (dp[j + 1] * C(xi + yi, xi) % mod)) % mod;
    }
  }
  printf("%lld\n", (dp[n + 1] + mod) % mod);
  return 0;
}
