#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int maxn = 100000;
const int maxk = 3000;
struct Node {
  int x, y;
} a[maxk + 5];
int n, m, k;
long long f[maxk + 5], jc[maxn * 2 + 5], jc_inv[maxn * 2 + 5], ans;
long long qpow(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = res * a % mod;
    b >>= 1;
    a = a * a % mod;
  }
  return res;
}
long long C(int x, int y) {
  return jc[x] * jc_inv[y] % mod * jc_inv[x - y] % mod;
}
long long calc(int x, int y) { return C(x + y, x); }
bool cmp(const Node &a, const Node &b) {
  return (a.x < b.x || (a.x == b.x && a.y < b.y));
}
int main() {
  scanf("%d %d %d", &n, &m, &k);
  n--;
  m--;
  jc[0] = jc_inv[0] = 1;
  for (int i = 1; i <= n + m; i++)
    jc[i] = jc[i - 1] * i % mod,
    jc_inv[i] = jc_inv[i - 1] * qpow(i, mod - 2) % mod;
  for (int i = 1; i <= k; i++) {
    scanf("%d %d", &a[i].x, &a[i].y);
    a[i].x--;
    a[i].y--;
  }
  sort(a + 1, a + 1 + k, cmp);
  ans = calc(n, m);
  for (int i = 1; i <= k; i++) {
    f[i] = calc(a[i].x, a[i].y);
    for (int j = 1; j < i; j++)
      if (a[j].x <= a[i].x && a[j].y <= a[i].y) {
        f[i] =
            (f[i] - f[j] * calc(a[i].x - a[j].x, a[i].y - a[j].y) % mod) % mod;
      }
    ans = (ans - f[i] * calc(n - a[i].x, m - a[i].y) % mod) % mod;
  }
  printf("%lld\n", (ans + mod) % mod);
  return 0;
}
