#include <bits/stdc++.h>
using namespace std;
const int N = 2e3 + 5, H = 1e5 + 5;
const long long MOD = 1e9 + 7;
int h, w, n;
int r[N], c[N];
long long fact[H * 2], invfact[H * 2];
long long dp[N];
long long fastexp(long long a, long long x, long long m) {
  if (a == 0) return 0;
  long long ans = 1;
  while (x) {
    if (x & 1) ans = ans * a % m;
    a = a * a % m;
    x >>= 1;
  }
  return ans;
}
long long choose(long long n, long long k) {
  return fact[n] * invfact[k] % MOD * invfact[n - k] % MOD;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> h >> w >> n;
  for (int i = 0; i < (int)(n); i++) cin >> r[i] >> c[i];
  r[n] = h, c[n] = w;
  fact[0] = invfact[0] = 1;
  fact[1] = invfact[1] = 1;
  for (int i = (2); i <= (int)(h + w); i += (1)) {
    fact[i] = fact[i - 1] * i % MOD;
    invfact[i] = invfact[i - 1] * fastexp(i, MOD - 2, MOD) % MOD;
  }
  vector<int> idx;
  for (int i = 0; i < (int)(n + 1); i++) idx.push_back(i);
  sort(idx.begin(), idx.end(), [&](int i, int j) {
    return make_pair(r[i], c[i]) < make_pair(r[j], c[j]);
  });
  for (int i = 0; i < (int)(n + 1); i++) {
    int x = idx[i];
    dp[i] = choose(r[x] + c[x] - 2, r[x] - 1);
    for (int j = 0; j < (int)(i); j++) {
      int y = idx[j];
      if (r[y] <= r[x] && c[y] <= c[x]) {
        long long cur =
            dp[j] * choose(r[x] - r[y] + c[x] - c[y], r[x] - r[y]) % MOD;
        dp[i] += MOD - cur, dp[i] %= MOD;
      }
    }
  }
  cout << dp[n] << '\n';
  return 0;
}
