#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200005, MOD = 1e9 + 7;
struct black {
  int x, y;
  bool operator<(black a) const {
    if (a.x == x) return y < a.y;
    return x < a.x;
  }
} B[MAXN];
int h, w, n;
long long fac[MAXN], inv[MAXN], f[MAXN];
long long get_c(int n, int m) {
  return fac[n] * inv[m] % MOD * inv[n - m] % MOD;
}
long long power(long long a, long long n) {
  long long rtn = 1;
  while (n) {
    if (n & 1) rtn = rtn * a % MOD;
    a = a * a % MOD;
    n >>= 1;
  }
  return rtn;
}
int main() {
  fac[0] = 1;
  inv[0] = 1;
  for (int i = 1; i < MAXN; i++)
    fac[i] = fac[i - 1] * i % MOD, inv[i] = power(fac[i], MOD - 2);
  cin >> h >> w >> n;
  for (int i = 1; i <= n; i++) cin >> B[i].x >> B[i].y;
  sort(B + 1, B + 1 + n);
  f[0] = 1;
  B[n + 1].x = h;
  B[n + 1].y = w;
  for (int i = 1; i <= n + 1; i++) {
    f[i] = get_c(B[i].x + B[i].y - 2, B[i].x - 1);
    for (int j = 1; j < i; j++) {
      if (B[j].x > B[i].x || B[j].y > B[i].y) continue;
      f[i] = ((f[i] - f[j] * get_c(B[i].x - B[j].x + B[i].y - B[j].y,
                                   B[i].x - B[j].x)) %
                  MOD +
              MOD) %
             MOD;
    }
  }
  cout << f[n + 1] % MOD << endl;
  return 0;
}
