#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
long long fac[10000001], f[2001];
struct node {
  int x, y;
  bool operator<(node X) const {
    if (x == X.x) return y < X.y;
    return x < X.x;
  }
} E[2001];
long long cal(long long a, long long b) {
  if (b == 1) return a;
  long long ret = cal(a, b / 2);
  if (b & 1)
    ret = ret * ret % mod * a % mod;
  else
    ret = ret * ret % mod;
  return ret;
}
long long lucas(long long a, long long b) {
  if (b > a || b < 0) return 0;
  long long x = fac[a];
  return x * cal(fac[b] * fac[a - b] % mod, mod - 2) % mod;
}
int main() {
  fac[0] = 1;
  for (long long i = 1; i <= 10000000; i++) fac[i] = fac[i - 1] * i % mod;
  int h, w, n;
  while (scanf("%d%d%d", &h, &w, &n) != EOF) {
    for (int i = 0, x, y; i < n; i++) {
      scanf("%d%d", &x, &y);
      E[i].x = x - 1, E[i].y = y - 1;
    }
    sort(E, E + n);
    E[n].x = h - 1, E[n++].y = w - 1;
    for (int i = 0; i < n; i++) {
      f[i] = lucas(E[i].x + E[i].y, E[i].x);
      for (int j = 0; j < i; j++)
        if (E[j].y <= E[i].y)
          f[i] =
              (mod + f[i] -
               f[j] *
                   lucas(E[i].x - E[j].x + E[i].y - E[j].y, E[i].x - E[j].x) %
                   mod) %
              mod;
    }
    printf("%I64d\n", f[n - 1] % mod);
  }
}
