#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
const int maxk = 2005;
const int mod = 1000000007;
struct node {
  int x, y;
  inline bool operator<(const node &no) const {
    if (x != no.x) return x < no.x;
    return y < no.y;
  }
} a[maxk];
int n, m, k;
long long inv[maxn << 1], fac[maxn << 1], inv_fac[maxn << 1], f[maxk];
long long C(int n, int m) {
  return fac[n + m] * inv_fac[n] % mod * inv_fac[m] % mod;
}
int main() {
  int i, j;
  scanf("%d%d%d", &n, &m, &k);
  inv[1] = 1;
  fac[0] = fac[1] = 1;
  inv_fac[0] = inv_fac[1] = 1;
  for (i = 2; i <= n + m; i++) {
    fac[i] = fac[i - 1] * i % mod;
    inv[i] = (-(mod / i) * inv[mod % i]) % mod + mod;
    inv_fac[i] = inv_fac[i - 1] * inv[i] % mod;
  }
  for (i = 0; i < k; i++) scanf("%d%d", &a[i].x, &a[i].y);
  sort(a, a + k);
  a[k].x = n;
  a[k].y = m;
  for (i = 0; i <= k; i++) {
    f[i] = C(a[i].x - 1, a[i].y - 1);
    for (j = 0; j < i; j++)
      if (a[i].y >= a[j].y) {
        f[i] -= f[j] * C(a[i].x - a[j].x, a[i].y - a[j].y) % mod;
        if (f[i] < 0) f[i] += mod;
      }
  }
  printf("%I64d\n", f[k]);
  return 0;
}
