#include <bits/stdc++.h>
using namespace std;
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};
const int maxn = 200010;
const double eps = 1e-8;
const int mod = 1000000007;
pair<int, int> a[2020];
int fac[maxn], inv[maxn];
int d[2020];
int p(int x, int y) {
  if (y == 0) return 1;
  long long tmp = p(x, y >> 1);
  tmp = tmp * tmp % mod;
  if (y & 1) tmp = tmp * x % mod;
  return tmp;
}
int C(int a, int b) { return (1LL * fac[a + b] * inv[a] % mod) * inv[b] % mod; }
int main() {
  fac[0] = inv[0] = 1;
  for (int i = 1; i < maxn; ++i) {
    fac[i] = 1LL * fac[i - 1] * i % mod;
    inv[i] = p(fac[i], mod - 2);
    assert(1LL * fac[i] * inv[i] % mod == 1);
  }
  int n, m, k;
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 0; i < k; ++i) {
    scanf("%d%d", &a[i].first, &a[i].second);
  }
  sort(a, a + k);
  long long all = C(n - 1, m - 1);
  for (int i = 0; i < k; ++i) {
    d[i] = C(a[i].first - 1, a[i].second - 1);
    for (int j = 0; j < i; ++j)
      if (a[j].second <= a[i].second) {
        d[i] -= 1LL * d[j] *
                C(a[i].first - a[j].first, a[i].second - a[j].second) % mod;
        d[i] %= mod;
        if (d[i] < 0) d[i] += mod;
      }
    all -= 1LL * d[i] * C(n - a[i].first, m - a[i].second);
    all = all % mod;
    if (all < 0) all += mod;
  }
  printf("%d\n", (int)all);
  return 0;
}
