#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 2222;
const int MAX_H = 1e5 * 2 + 20;
const int BIG = 1e9 + 7;
int H, W, N;
int R[MAX_N], C[MAX_N];
int numOfCases[MAX_N];
int fac[MAX_H];
int fac_mul_inv[MAX_H];
vector<pair<int, int> > box;
int calc(int a, int b) {
  return ((long long)(((long long)fac[a + b] * fac_mul_inv[a]) % BIG) *
          fac_mul_inv[b]) %
         BIG;
}
int exp_mod(int base, int exp, int d) {
  if (!exp) return 1;
  if (exp & 1) return ((long long)exp_mod(base, exp - 1, d) * base) % d;
  int half = exp_mod(base, exp >> 1, d) % d;
  return ((long long)half * half) % d;
}
int get_mul_inv(int b, int M) { return (long long)exp_mod(b, M - 2, M) % M; }
void calc_fac() {
  fac[0] = 1;
  for (int i = 1; i < MAX_H; i++) {
    fac[i] = ((long long)fac[i - 1] * i) % BIG;
  }
  for (int i = 0; i < MAX_H; i++) {
    fac_mul_inv[i] = get_mul_inv(fac[i], BIG);
  }
}
int main() {
  calc_fac();
  cin >> H >> W >> N;
  for (int i = 0; i < N; i++) {
    scanf("%d%d", R + i, C + i);
    box.push_back(make_pair(R[i], C[i]));
  }
  box.push_back(pair<int, int>(H, W));
  R[N] = H, C[N] = W;
  sort(box.begin(), box.end());
  for (int i = 0; i < N + 1; i++) R[i] = box[i].first, C[i] = box[i].second;
  for (int i = 0; i < box.size(); i++) {
    numOfCases[i] = calc(R[i] - 1, C[i] - 1);
    for (int j = 0; j < i; j++) {
      if (box[j].first > box[i].first || box[j].second > box[i].second)
        continue;
      numOfCases[i] -=
          ((long long)numOfCases[j] * calc(R[i] - R[j], C[i] - C[j])) % BIG;
      numOfCases[i] = (numOfCases[i] + BIG) % BIG;
    }
  }
  cout << fixed << numOfCases[N] << endl;
}
