#include <bits/stdc++.h>
using namespace std;
int T = 1;
inline long long modPow(long long a, long long p) {
  long long res = 1;
  a %= 1000000007;
  while (p > 0) {
    if (p & 1) res = (res * a) % 1000000007;
    p >>= 1;
    a = (a * a) % 1000000007;
  }
  return res;
}
inline long long modInv(long long a) { return modPow(a, 1000000007 - 2); }
long long fact[200050];
long long dp[2005];
long long alp(pair<int, int> p1, pair<int, int> p2) {
  long long r = p2.first - p1.first;
  long long c = p2.second - p1.second;
  long long ans = (fact[r + c] * modInv(fact[r])) % 1000000007;
  ans = (ans * modInv(fact[c])) % 1000000007;
  return ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  fact[0] = 1;
  for (int i = 1; i < 200050; ++i) {
    fact[i] = (i * fact[i - 1]) % 1000000007;
  }
  long long h, w, n;
  cin >> h >> w >> n;
  vector<pair<int, int> > bc;
  for (int i = 0; i < n; ++i) {
    pair<int, int> e;
    cin >> e.first >> e.second;
    bc.push_back(e);
  }
  sort(bc.begin(), bc.end());
  for (int i = 0; i < n; ++i) {
    dp[i] = alp(make_pair(1, 1), bc[i]);
    for (int j = 0; j < i; ++j) {
      if (bc[j].first <= bc[i].first && bc[j].second <= bc[i].second) {
        dp[i] -= (dp[j] * alp(bc[j], bc[i])) % 1000000007;
        dp[i] = (dp[i] + 1000000007) % 1000000007;
      }
    }
  }
  long long ans = alp(make_pair(1, 1), make_pair(h, w));
  for (int j = 0; j < n; ++j) {
    if (bc[j].first <= h and bc[j].second <= w) {
      ans -= (dp[j]) * alp(bc[j], make_pair(h, w)) % 1000000007;
      ans = (ans + 1000000007) % 1000000007;
    }
  }
  cout << ans;
  return 0;
}
