#include <bits/stdc++.h>
const int maxn = 1e5 * 2;
const int maxq = 2000;
const long long int mod = 1e9 + 7;
using namespace std;
struct node {
  int x, y;
  long long int delta;
  node() {}
  node(int a, int b) { x = a, y = b; }
} qry[maxq + 5];
int h, w, n;
long long int fc[maxn + 5], Ni[maxn + 5];
long long int pow(long long int a, long long int b) {
  long long int ret = 1;
  while (b) {
    if (b & 1) ret = (ret * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return ret;
}
void pre() {
  fc[0] = 1;
  Ni[0] = 1;
  for (int i = 1; i <= maxn; i++) {
    fc[i] = fc[i - 1] * i % mod;
    Ni[i] = pow(fc[i], mod - 2);
  }
}
long long int calc(int m, int n) {
  if (2 * n > m) n = m - n;
  return (fc[m] * Ni[n]) % mod * Ni[m - n] % mod;
}
bool cmp(node a, node b) {
  if (a.x != b.x)
    return a.x < b.x;
  else
    return a.y < b.y;
}
int main() {
  pre();
  scanf("%d%d%d", &h, &w, &n);
  int a, b;
  int ta, tb;
  for (int i = 1; i <= n; i++) scanf("%d%d", &qry[i].x, &qry[i].y);
  qry[++n] = node(h, w);
  sort(qry + 1, qry + 1 + n, cmp);
  for (int i = 1; i <= n; i++) {
    a = qry[i].x, b = qry[i].y;
    qry[i].delta = calc(a + b - 2, a - 1);
    if (qry[i].delta < 0) qry[i].delta += mod;
    for (int j = 1; j < i; j++) {
      ta = qry[j].x, tb = qry[j].y;
      if (a >= ta && b >= tb)
        qry[i].delta -= (qry[j].delta * calc(a - ta + b - tb, a - ta)) % mod;
      if (qry[i].delta < 0) qry[i].delta += mod;
    }
  }
  cout << qry[n].delta;
}
