#include <bits/stdc++.h>
using namespace std;
const long long maxm = 2e5 + 5;
const long long mod = 1e9 + 7;
long long fac[maxm], inv[maxm];
struct Node {
  long long x, y;
} e[maxm];
long long d[maxm];
long long n, m, k;
long long ppow(long long a, long long b, long long mod) {
  long long ans = 1 % mod;
  a %= mod;
  while (b) {
    if (b & 1) ans = ans * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return ans;
}
void init() {
  fac[0] = 1;
  for (long long i = 1; i < maxm; i++) fac[i] = fac[i - 1] * i % mod;
  inv[maxm - 1] = ppow(fac[maxm - 1], mod - 2, mod);
  for (long long i = maxm - 2; i >= 0; i--) inv[i] = (i + 1) * inv[i + 1] % mod;
}
long long C(long long n, long long m) {
  if (m < 0 || m > n) return 0;
  return fac[n] * inv[m] % mod * inv[n - m] % mod;
}
signed main() {
  init();
  cin >> n >> m >> k;
  for (long long i = 1; i <= k; i++) {
    cin >> e[i].x >> e[i].y;
  }
  e[++k] = {n, m};
  sort(e + 1, e + 1 + k, [](Node a, Node b) -> bool {
    if (a.x == b.x) return a.y < b.y;
    return a.x < b.x;
  });
  for (long long i = 1; i <= k; i++) {
    d[i] = C(e[i].x + e[i].y - 2, e[i].x - 1);
    for (long long j = 1; j < i; j++) {
      if (e[j].x <= e[i].x && e[j].y <= e[i].y) {
        d[i] -=
            d[j] * C(e[i].x - e[j].x + e[i].y - e[j].y, e[i].x - e[j].x) % mod;
        d[i] %= mod;
      }
    }
  }
  cout << (d[k] + mod) % mod << endl;
  return 0;
}
