#include <bits/stdc++.h>
using namespace std;
const int N = 2e3 + 4, P = 1e9 + 7, H = 2e5 + 5;
long long h, w, n, fac[H] = {1}, inv[H] = {1}, dp[N];
pair<int, int> a[N];
int power(int a, int b = P - 2) {
  if (!b) return 1;
  int t = power(a, b / 2);
  return 1ll * t * t % P * (b & 1 ? a : 1) % P;
}
int ncr(int n, int k) { return fac[n] * inv[k] % P * inv[n - k] % P; }
int calc(int x, int y, int z = 1, int t = 1) {
  return t > y ? 0 : ncr(x - z + y - t, x - z);
}
int main() {
  for (int i = 1; i < H; i++) inv[i] = power(fac[i] = fac[i - 1] * i % P);
  cin >> h >> w >> n;
  for (int i = 0; i < n; i++) cin >> a[i].first >> a[i].second;
  a[n++] = {h, w};
  sort(a, a + n);
  for (int i = 0; i < n; i++) {
    auto [x, y] = a[i];
    dp[i] = calc(x, y);
    for (int j = 0; j < i; j++)
      dp[i] = (dp[i] - dp[j] * calc(x, y, a[j].first, a[j].second) % P + P) % P;
  }
  cout << dp[n - 1] << endl;
}
