#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9, MOD = INF + 7;
const long long N = 2e5 + 20, M = 2e3 + 20;
long long l[N], f[N], dp[M];
long long power(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = (ans * a) % MOD;
    a = (a * a) % MOD;
    b >>= 1;
  }
  return ans;
}
long long c(long long a, long long b) {
  return (a > b ? 0 : (f[b] * ((l[a] * l[b - a]) % MOD)) % MOD);
}
int32_t main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  f[0] = 1;
  for (long long i = 1; i < N; i++) f[i] = (f[i - 1] * i) % MOD;
  l[N - 1] = power(f[N - 1], MOD - 2);
  for (long long i = N - 2; i >= 0; i--) l[i] = (l[i + 1] * (i + 1)) % MOD;
  long long h, w, n;
  cin >> h >> w >> n;
  vector<pair<long long, long long> > v;
  for (long long i = 0; i < n; i++) {
    long long x, y;
    cin >> x >> y;
    v.push_back(make_pair(x, y));
  }
  v.push_back(make_pair(h, w));
  sort(v.begin(), v.end());
  for (long long i = 0; i < v.size(); i++) {
    dp[i] = c(v[i].first - 1, v[i].first + v[i].second - 2);
    for (long long j = 0; j < i; j++) {
      dp[i] -=
          (dp[j] * c(v[i].first - v[j].first,
                     v[i].first + v[i].second - v[j].first - v[j].second)) %
          MOD;
      dp[i] = (dp[i] + MOD) % MOD;
    }
  }
  cout << dp[n] << "\n";
  return 0;
}
