#include <bits/stdc++.h>
using namespace std;
const int N = 2e3 + 10, H = 2e5 + 10, MOD = 1e9 + 7;
struct node {
  int x, y;
} a[N];
long long fac[H], inv[H], f[N];
int h, w, n;
long long popow(long long x, int y) {
  long long t = x, re = 1;
  while (y) {
    if (y & 1) re = re * t % MOD;
    t = t * t % MOD;
    y >>= 1;
  }
  return re;
}
void prepare() {
  fac[0] = inv[0] = 1;
  for (int i = 1; i <= 2e5; ++i) {
    fac[i] = fac[i - 1] * i % MOD;
    inv[i] = popow(fac[i], MOD - 2);
  }
}
bool cmp(const node &aa, const node &bb) {
  return aa.x < bb.x || (aa.x == bb.x && aa.y < bb.y);
}
long long calc(int aa, int bb) {
  if (aa < bb) return 0;
  return fac[aa] * inv[bb] % MOD * inv[aa - bb] % MOD;
}
int main() {
  prepare();
  scanf("%d%d%d", &h, &w, &n);
  for (int i = 1; i <= n; ++i) scanf("%d%d", &a[i].x, &a[i].y);
  ++n;
  a[n].x = h;
  a[n].y = w;
  sort(&a[1], &a[1 + n], cmp);
  for (int i = 1; i <= n; ++i) {
    f[i] = calc(a[i].x + a[i].y - 2, a[i].x - 1);
    for (int j = 1; j < i; ++j)
      if (a[j].y <= a[i].y) {
        f[i] -= f[j] * calc(a[i].x + a[i].y - a[j].x - a[j].y, a[i].x - a[j].x);
        f[i] %= MOD;
      }
  }
  printf("%lld\n", (f[n] + MOD) % MOD);
  return 0;
}
