#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:66777216")
using namespace std;
const double eps = 1e-7;
const double pi = acos(-1.0);
const int inf = (int)2e9 + 1;
const long long linf = (long long)9e18 + 7;
int solve();
void gen();
int main() {
  solve();
  return 0;
}
const int MAXN = 3e5 + 7;
const long long MM = (long long)1e9 + 7;
long long fact[MAXN], tcaf[MAXN];
long long dp[2007];
long long fp(long long a, long long n) {
  n %= MM - 1;
  if (n < 0) n += MM - 1;
  long long res = 1;
  for (; n; n /= 2) {
    if (n & 1) res *= a, res %= MM;
    a *= a, a %= MM;
  }
  return res;
}
long long CNK(int n, int k) {
  return fact[n] * tcaf[k] % MM * tcaf[n - k] % MM;
}
int solve() {
  fact[0] = tcaf[0] = 1;
  for (long long i = 1; i < (long long)MAXN; i++)
    fact[i] = i * fact[i - 1] % MM, tcaf[i] = fp(fact[i], -1);
  int h, w, n;
  cin >> h >> w >> n;
  vector<pair<int, int> > p(n);
  for (long long i = 0; i < (long long)n; i++) cin >> p[i].first >> p[i].second;
  p.push_back({h, w});
  sort(p.begin(), p.end());
  for (long long i = 0; i < (long long)n + 1; i++) {
    dp[i] = CNK(p[i].first + p[i].second - 2, p[i].first - 1);
    for (long long j = 0; j < (long long)i; j++) {
      if (p[j].first <= p[i].first && p[j].second <= p[i].second)
        dp[i] =
            (dp[i] + MM -
             dp[j] * CNK(p[i].first - p[j].first + p[i].second - p[j].second,
                         p[i].first - p[j].first)) %
            MM;
    }
  }
  cout << (dp[n] + MM) % MM;
  return 0;
}
