#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
pair<int, int> p[2005];
long long dp[5005];
long long fac[410005];
long long inv[410005];
long long ppower(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % 1000000007;
    a = a * a % 1000000007;
    b >>= 1;
  }
  return ans;
}
void init() {
  fac[0] = 1;
  for (int i = 1; i < 410005 - 10; i++) {
    fac[i] = (fac[i - 1] * i) % 1000000007;
  }
  inv[0] = 1;
  for (int i = 1; i < 410005 - 10; i++) {
    inv[i] = inv[i - 1] * ppower(i, 1000000007 - 2) % 1000000007;
  }
}
long long C(int a, int b) {
  if (b > a || a < 0 || b < 0) return 0;
  long long ans = fac[a] * inv[b] % 1000000007 * inv[a - b] % 1000000007;
  return ans;
}
int main() {
  int h, w, n;
  init();
  while (cin >> h >> w >> n) {
    for (int i = 0; i < n; i++) {
      cin >> p[i].first;
      cin >> p[i].second;
    }
    p[n].first = h;
    p[n].second = w;
    sort(p, p + n + 1);
    dp[0] = C(p[0].first + p[0].second - 2, p[0].first - 1);
    for (int i = 1; i <= n; i++) {
      long long ans = 0;
      for (int j = 0; j < i; j++) {
        int x = p[i].first - p[j].first;
        int y = p[i].second - p[j].second;
        ans = (ans + dp[j] * C(x + y, x) % 1000000007) % 1000000007;
      }
      dp[i] =
          (C(p[i].first + p[i].second - 2, p[i].first - 1) - ans) % 1000000007;
      dp[i] = (dp[i] + 1000000007) % 1000000007;
    }
    cout << dp[n] << endl;
  }
  return 0;
}
