#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
long long dp[6005];
pair<int, int> s[6005];
int f[1 << 21];
int c[1 << 21];
long long pw(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 (((1ll * f[b] * c[a]) % mod) * c[b - a]) % mod;
}
int main(void) {
  int h, w, n;
  cin >> h >> w >> n;
  for (int i = 1; i <= n; ++i) cin >> s[i].first >> s[i].second;
  sort(s + 1, s + 1 + n);
  s[++n] = make_pair(h, w);
  f[0] = 1;
  c[0] = 1;
  const int N = 2e6;
  for (int i = 1; i <= N; ++i) {
    f[i] = (1ll * i * f[i - 1]) % mod;
  }
  c[N] = pw(f[N], mod - 2);
  for (int i = N - 1; i; --i) c[i] = (1ll * c[i + 1] * (i + 1)) % mod;
  for (int i = 1; i <= n; ++i) {
    dp[i] = C(s[i].first - 1, s[i].first + s[i].second - 2);
    for (int j = i - 1; j; --j)
      if (s[j].first <= s[i].first && s[j].second <= s[i].second) {
        long long p = C(s[i].first - s[j].first,
                        s[i].first + s[i].second - s[j].first - s[j].second);
        p *= dp[j];
        p %= mod;
        dp[i] -= p;
        if (dp[i] < 0) dp[i] += mod;
      }
    dp[i] %= mod;
  }
  return cout << dp[n] << '\n', 0;
}
