#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2010;
const int MAXV = 200010;
const int MOD = 1000000007;
int fact[MAXV], inv[MAXV];
pair<int, int> pts[MAXN];
int dp[MAXN];
int mypow(int x, int y) {
  if (!y) return 1;
  long long ans = mypow(x, y / 2);
  ans = ans * ans % MOD;
  if (y & 1) ans = ans * x % MOD;
  return ans;
}
void preproc() {
  fact[0] = inv[0] = 1;
  for (int i = 1; i < (200001); ++i) {
    fact[i] = fact[i - 1] * 1LL * i % MOD;
    inv[i] = mypow(fact[i], MOD - 2);
  }
}
int nCk(int n, int k) {
  int ans = fact[n];
  ans = ans * 1LL * inv[n - k] % MOD;
  ans = ans * 1LL * inv[k] % MOD;
  return ans;
}
int ways(int x1, int y1, int x2, int y2) {
  int dx = abs(x1 - x2);
  int dy = abs(y2 - y1);
  return nCk(dx + dy, dx);
}
int main() {
  ios::sync_with_stdio(false);
  preproc();
  int n, m, q;
  cin >> n >> m >> q;
  for (int i = 0; i < (q); ++i) {
    cin >> pts[i].first >> pts[i].second;
    --pts[i].first;
    --pts[i].second;
  }
  pts[q++] = {n - 1, m - 1};
  sort(pts, pts + q);
  for (int i = 0; i < (q); ++i) {
    int& ans = dp[i];
    int x = pts[i].first;
    int y = pts[i].second;
    ans = ways(0, 0, x, y);
    for (int j = 0; j < (i); ++j)
      if (pts[j].second <= y) {
        int parc = dp[j] * 1LL * ways(pts[j].first, pts[j].second, x, y) % MOD;
        ans = (ans - parc) % MOD;
      }
  }
  if (dp[q - 1] < 0) dp[q - 1] += MOD;
  cout << dp[q - 1] << endl;
  return 0;
}
