#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 100, MOD = 1e9 + 7;
int fac[N], inv[N], dp[N], x[N], y[N], a[N];
int n, h, w;
int sum(int a, int b) {
  a += b;
  if (a >= MOD) a -= MOD;
  if (a < 0) a += MOD;
  return a;
}
int mul(int a, int b) { return (1LL * a * b) % MOD; }
int power(int a, int p) {
  int res = 1;
  for (; p; p /= 2) {
    if (p % 2) res = mul(res, a);
    a = mul(a, a);
  }
  return res;
}
int C(int k, int n) { return 1LL * fac[n] * inv[k] % MOD * inv[n - k] % MOD; }
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  fac[0] = 1;
  for (int i = 1; i < N; i++) fac[i] = mul(i, fac[i - 1]);
  for (int i = 0; i < N; i++) inv[i] = power(fac[i], MOD - 2);
  cin >> h >> w >> n;
  for (int i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
    x[i]--;
    y[i]--;
    a[i] = i;
  }
  a[n] = n;
  x[n] = h - 1, y[n] = w - 1;
  sort(a, a + n + 1, [&](int i, int j) {
    return (x[i] != x[j] ? x[i] < x[j] : y[i] < y[j]);
  });
  for (int i = 0; i <= n; i++) {
    dp[i] = C(x[a[i]], x[a[i]] + y[a[i]]);
    for (int j = 0; j < i; j++) {
      if (y[a[j]] > y[a[i]]) continue;
      int tmp1 = x[a[i]] - x[a[j]], tmp2 = y[a[i]] - y[a[j]];
      dp[i] = sum(dp[i], -mul(dp[j], C(tmp1, tmp1 + tmp2)));
    }
  }
  return cout << dp[n], 0;
}
