#include <bits/stdc++.h>
using namespace std;
inline int gi() {
  int f = 1, x = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -f;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  return f * x;
}
const int N = 2005, mod = 1e9 + 7;
int add(int a, int b) { return ((a += b) >= mod ? a - mod : a); }
int sub(int a, int b) { return ((a -= b) < 0 ? a + mod : a); }
int fpw(int a, int b) {
  int res = 1;
  while (b) {
    if (b & 1) res = (long long)res * a % mod;
    a = (long long)a * a % mod, b >>= 1;
  }
  return res;
}
int h, w, n;
int fac[200005], ifac[200005];
void WORK(int x) {
  fac[0] = 1;
  for (int i = (1); i <= (x); ++i) fac[i] = (long long)fac[i - 1] * i % mod;
  ifac[x] = fpw(fac[x], mod - 2);
  for (int i = (x - 1); i >= (0); --i)
    ifac[i] = (long long)ifac[i + 1] * (i + 1) % mod;
}
int C(int a, int b) {
  if (a < b) return 0;
  return (long long)fac[a] * ifac[a - b] % mod * ifac[b] % mod;
}
int x[N], y[N], dp[N];
int fst(int i) {
  if (~dp[i]) return dp[i];
  dp[i] = C(x[i] - 1 + y[i] - 1, x[i] - 1);
  for (int j = (1); j <= (n); ++j)
    if (x[j] <= x[i] && y[j] <= y[i] && j != i) {
      dp[i] = sub(dp[i], (long long)fst(j) *
                             C(x[i] - x[j] + y[i] - y[j], y[i] - y[j]) % mod);
    }
  return dp[i];
}
int main() {
  memset(dp, -1, sizeof(dp));
  h = gi(), w = gi(), n = gi();
  WORK(h + w);
  for (int i = (1); i <= (n); ++i) x[i] = gi(), y[i] = gi();
  int ans = C(h - 1 + w - 1, w - 1);
  for (int i = (1); i <= (n); ++i) {
    ans = sub(ans, (long long)fst(i) * C(h - x[i] + w - y[i], w - y[i]) % mod);
  }
  cout << ans;
  return 0;
}
