#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-6;
const double PI = 3.14159265358979323846264338f;
const double pi = acos(-1.0);
const int inf = 0x3f3f3f3f;
const long long mod = 1e9 + 7;
const int MAXN = 2005;
inline int read() {
  int c = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    c = c * 10 + ch - '0';
    ch = getchar();
  }
  return c * f;
}
pair<long long, long long> a[MAXN];
long long fac[2000005], dp[MAXN];
long long pow_mod(long long x, long long n, long long p) {
  long long ans = 1;
  x %= p;
  while (n) {
    if (n & 1) ans = ans * x % p;
    x = x * x % p;
    n >>= 1;
  }
  return ans;
}
int main() {
  int n, m, t;
  cin >> n >> m >> t;
  for (int i = 1; i <= t; i++) {
    cin >> a[i].first >> a[i].second;
  }
  sort(a + 1, a + 1 + t);
  a[0].first = a[0].second = 1;
  a[t + 1].first = n, a[t + 1].second = m;
  for (int i = fac[0] = 1; i <= n + m; i++) {
    fac[i] = (fac[i - 1] * (long long)i) % mod;
  }
  auto C = [](long long x, long long y) -> long long {
    if (x == 0) return 1;
    long long tmp = pow_mod((fac[x] * fac[y - x]) % mod, mod - 2, mod);
    return (fac[y] * tmp) % mod;
  };
  for (int i = 1; i <= t + 1; i++) {
    dp[i] = C(a[i].first - a[0].first,
              a[i].first + a[i].second - a[0].first - a[0].second);
    for (int j = 1; j < i; j++) {
      if (a[j].second <= a[i].second) {
        dp[i] -= dp[j] *
                 C(a[i].first - a[j].first,
                   a[i].first + a[i].second - a[j].first - a[j].second) %
                 mod;
        dp[i] = (dp[i] % mod) + mod;
        dp[i] %= mod;
      }
    }
  }
  cout << dp[t + 1] << "\n";
  return 0;
}
