#include <bits/stdc++.h>
using namespace std;
const long long N = 2e3 + 5, M = 2e5 + 5, mod = 1e9 + 7, inf = 1e9 + 7;
long long h, w, n;
long long fac[M], invfac[M];
long long dp[N];
vector<pair<long long, long long> > a;
long long binpow(long long x, long long y) {
  long long ans = 1;
  while (y) {
    if (y & 1) ans = (1ll * ans * x) % mod;
    x = (1ll * x * x) % mod;
    y >>= 1;
  }
  return ans;
}
long long cal(long long x, long long y) {
  long long ans = (invfac[x] * invfac[y - x]) % mod;
  ans = (ans * fac[y]) % mod;
  return ans;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  fac[0] = 1;
  invfac[0] = 1;
  for (long long i = 1; i < M; i++) {
    fac[i] = (fac[i - 1] * i) % mod;
    invfac[i] = binpow(fac[i], mod - 2);
  }
  cin >> h >> w >> n;
  for (long long i = 0; i < n; i++) {
    long long x, y;
    cin >> x >> y;
    a.push_back({x, y});
  }
  a.push_back({h, w});
  sort(a.begin(), a.end());
  for (long long i = 0; i <= n; i++) {
    dp[i] = cal(a[i].first - 1, a[i].first + a[i].second - 2);
    for (long long j = 0; j < i; j++) {
      if (a[j].first <= a[i].first && a[j].second <= a[i].second) {
        dp[i] =
            (dp[i] -
             dp[j] * cal((a[i].first - a[j].first) % mod,
                         (a[i].first + a[i].second - a[j].first - a[j].second) %
                             mod)) %
            mod;
        if (dp[i] < 0) {
          dp[i] += mod;
        }
      }
    }
  }
  cout << dp[n];
}
