#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int inf = 0x3f3f3f3f;
const long long INF = 1e18;
const int N = 2002;
const int M = 2e5 + 5;
struct node {
  int x, y;
} a[N];
long long fac[M], inv[M], f[M];
long long ksm(long long x, long long y) {
  long long t = 1;
  while (y) {
    if (y & 1) t = t * x % mod;
    y >>= 1;
    x = x * x % mod;
  }
  return t;
}
void init(int n) {
  fac[0] = inv[0] = 1;
  for (int i = 1; i <= n; i++) {
    fac[i] = (fac[i - 1] * i) % mod;
    inv[i] = ksm(fac[i], mod - 2);
  }
}
long long C(int n, int m) {
  if (n < 0 || m < 0) return 0;
  return fac[n] * inv[n - m] % mod * inv[m] % mod;
}
int main() {
  int h, w, k;
  scanf("%d%d%d", &h, &w, &k);
  for (int i = 0; i < k; i++) scanf("%d%d", &a[i].x, &a[i].y);
  init(h + w);
  a[k].x = h, a[k].y = w;
  sort(a, a + k + 1, [&](node A, node B) {
    if (A.x == B.x) return A.y < B.y;
    return A.x < B.x;
  });
  for (int i = 0; i <= k; i++) {
    f[i] = C(a[i].x - 1 + a[i].y - 1, a[i].x - 1);
    for (int j = 0; j < i; j++) {
      int n = a[i].x - a[j].x;
      int m = a[i].y - a[j].y;
      if (n >= 0 && m >= 0)
        f[i] = (f[i] - f[j] * C(n + m, n) % mod + mod) % mod;
    }
  }
  printf("%lld\n", f[k]);
  return 0;
}
