#include <bits/stdc++.h>
using namespace std;
struct cell {
  int r, c;
};
bool cmp(struct cell a, struct cell b) {
  if (a.r != b.r) return a.r < b.r;
  return a.c < b.c;
}
int h, w, n;
cell c[2001];
long long dp[2001], fc[200001], ifc[200001];
long long pow(long long a, int p = 1000000007 - 2) {
  long long rem = 1LL;
  while (p) {
    if (p & 1) {
      rem *= a;
      rem %= 1000000007;
    }
    a *= a;
    a %= 1000000007;
    p >>= 1;
  }
  return rem;
}
void init() {
  fc[0] = ifc[0] = 1LL;
  fc[1] = ifc[1] = 1LL;
  for (int i = (2); i < (200001); i++) fc[i] = (i * fc[i - 1]) % 1000000007;
  for (int i = (2); i < (200001); i++)
    ifc[i] = (pow(i) * ifc[i - 1]) % 1000000007;
}
long long nCr(int n, int r) {
  if (n < 0 || r < 0) return 0LL;
  return (((fc[n] * ifc[r]) % 1000000007) * ifc[n - r]) % 1000000007;
}
int main() {
  init();
  cin >> h >> w >> n;
  for (int i = (0); i < (n); i++) cin >> c[i].r >> c[i].c;
  c[n].r = h, c[n].c = w;
  n++;
  sort(c, c + n, cmp);
  for (int i = (0); i < (n); i++) {
    dp[i] = nCr(c[i].r + c[i].c - 2, c[i].c - 1);
    for (int j = (0); j < (i); j++) {
      if ((c[i].r >= c[j].r) && (c[i].c >= c[j].c)) {
        dp[i] -= (dp[j] *
                  nCr((c[i].r - c[j].r) + (c[i].c - c[j].c), c[i].r - c[j].r)) %
                 1000000007;
        dp[i] = (dp[i] + 1000000007) % 1000000007;
      }
    }
  }
  cout << dp[n - 1] << '\n';
}
