#include <bits/stdc++.h>
using namespace std;
pair<int, int> input[2005];
long long int dp[2005] = {0}, fact[200005];
long long int powMod(long long int x, int n) {
  long long int result = 1;
  while (n) {
    if (n & 1) {
      result = (result * x) % 1000000007;
    }
    x = (x * x) % 1000000007;
    n = n >> 1;
  }
  return result;
}
long long int calcAns(int x, int y) {
  return (fact[x + y] *
          powMod((fact[x] * fact[y]) % 1000000007, 1000000007 - 2)) %
         1000000007;
}
int main() {
  long long int h, w;
  int n;
  cin >> h >> w >> n;
  int i;
  input[0].first = 1;
  input[0].second = 1;
  fact[0] = fact[1] = 1;
  for (i = 2; i <= 200002; i++) {
    fact[i] = (i * fact[i - 1]) % 1000000007;
  }
  for (i = 1; i <= n; i++) {
    int x, y;
    cin >> x >> y;
    input[i].first = x;
    input[i].second = y;
  }
  input[i].first = h;
  input[i].second = w;
  sort(input + 1, input + n + 2);
  dp[1] = calcAns(input[1].first - 1, input[1].second - 1);
  for (i = 2; i <= n + 1; i++) {
    long long int totalPaths = calcAns(input[i].first - 1, input[i].second - 1);
    for (int j = 1; j < i; j++) {
      if (input[i].first >= input[j].first &&
          input[i].second >= input[j].second) {
        long long int totalPathsFromJ = calcAns(
            input[i].first - input[j].first, input[i].second - input[j].second);
        totalPaths = (totalPaths - (dp[j] * totalPathsFromJ)) % 1000000007;
        if (totalPaths < 0) {
          totalPaths += 1000000007;
        }
      }
    }
    dp[i] = totalPaths;
  }
  cout << dp[n + 1] << endl;
  return 0;
}
