#include <bits/stdc++.h>
using namespace std;
long long int fact[200010];
long long int fact_inv[200010];
long long int gcd(long long int a, long long int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long int bin_pow_mod(long long int a, long long int b) {
  if (a == 0) return 1;
  int p = 1;
  while (b > 0) {
    if (b & 1) p = (p * a) % 1000000007;
    a = (a * a) % 1000000007;
    b >>= 1;
  }
  return p;
}
void init_fact() {
  fact[0] = fact_inv[0] = 1;
  for (long long int i = 1; i <= 200005; i++) {
    fact[i] = (fact[i - 1] * i) % 1000000007;
  }
  for (long long int i = 1; i <= 200005; i++) {
    fact_inv[i] = bin_pow_mod(fact[i], 1000000007 - 2);
  }
}
long long int ncr(long long int n, long long int r) {
  return (((fact[n] * fact_inv[n - r]) % 1000000007) * fact_inv[r]) %
         1000000007;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  init_fact();
  long long int h, w, n, i, x, y, k, r, c, p;
  pair<long long int, long long int> a[2005];
  long long int dp[20010];
  cin >> h >> w >> n;
  for (i = 0; i < n; i++) {
    cin >> x >> y;
    a[i] = {x, y};
  }
  a[n] = {h, w};
  sort(a, a + n + 1);
  for (i = 0; i <= n; i++) {
    r = a[i].first;
    c = a[i].second;
    dp[i] = ncr(r + c - 2, r - 1);
    for (k = 0; k < i; k++) {
      x = a[k].first;
      y = a[k].second;
      if (y > c) continue;
      p = ncr(r + c - x - y, r - x);
      p %= 1000000007;
      dp[i] = (dp[i] - (dp[k] * p) % 1000000007 + 1000000007) % 1000000007;
    }
  }
  cout << dp[n];
  return 0;
}
