#include <bits/stdc++.h>
using namespace std;
struct node {
  int x, y;
} e[2005];
bool cmp(node a, node b) {
  if (a.x == b.x) {
    return a.y < b.y;
  } else {
    return a.x < b.x;
  }
}
int dp[2005], mod = 1e9 + 7, fac[2 * 100005];
void init() {
  fac[0] = 1;
  for (int i = 1; i < 2 * 100005; i++) {
    fac[i] = 1LL * fac[i - 1] * i % mod;
  }
}
int quick_mod(long long x, int n) {
  int ans = 1;
  x %= mod;
  while (n) {
    if (n & 1) {
      ans = 1LL * ans * x % mod;
    }
    n >>= 1;
    x = 1LL * x * x % mod;
  }
  return ans;
}
int C(int n, int m) {
  return 1LL * fac[n] * quick_mod(1LL * fac[m] * fac[n - m], mod - 2) % mod;
}
int main() {
  int n, m, k;
  init();
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 0; i < k; i++) {
    scanf("%d%d", &e[i].x, &e[i].y);
    e[i].x--, e[i].y--;
  }
  e[k].x = n - 1, e[k].y = m - 1;
  k++;
  sort(e, e + k, cmp);
  if (e[0].x == 0 && e[0].y == 0) {
    printf("0\n");
    return 0;
  }
  for (int i = 0; i < k; i++) {
    dp[i] = C(e[i].x + e[i].y, e[i].x);
    for (int j = 0; j < i; j++) {
      if (e[i].y >= e[j].y && (e[i].x != e[j].x || e[i].y != e[j].y)) {
        dp[i] -= 1LL * dp[j] *
                 C(e[i].x + e[i].y - e[j].x - e[j].y, e[i].x - e[j].x) % mod;
        dp[i] = (dp[i] % mod + mod) % mod;
      }
    }
  }
  printf("%d\n", dp[k - 1]);
}
