#include <bits/stdc++.h>
using namespace std;
const int oo = 0x3f3f3f3f;
const int MAXH = (int)1e5 + 5, MAXN = 2005;
const int MOD = (int)1e9 + 7;
int H, W, N;
long long fac[MAXH * 2], inv[MAXH * 2];
long long g[MAXN];
pair<int, int> A[MAXN];
void exgcd(int a, int b, long long &first, long long &second) {
  if (b == 0) {
    first = 1;
    second = 0;
    return;
  }
  exgcd(b, a % b, second, first);
  second -= (a / b) * first;
}
inline long long inverse(int a) {
  long long first, second;
  exgcd(a, MOD, first, second);
  return (first % MOD + MOD) % MOD;
}
inline long long calc(int first, int second) {
  return fac[first + second] * inv[first] % MOD * inv[second] % MOD;
}
void init() {
  fac[0] = inv[0] = 1;
  for (int i = 1; i <= H + W; i++) {
    fac[i] = fac[i - 1] * i % MOD;
    inv[i] = inverse(fac[i]);
  }
}
int main() {
  scanf("%d%d%d", &H, &W, &N);
  for (int i = 0; i < N; i++) {
    scanf("%d%d", &A[i].first, &A[i].second);
    A[i].first--;
    A[i].second--;
  }
  sort(A, A + N);
  init();
  long long ans = calc(H - 1, W - 1);
  for (int i = 0; i < N; i++) {
    g[i] = calc(A[i].first, A[i].second);
    for (int j = 0; j < i; j++) {
      if (A[j].first <= A[i].first && A[j].second <= A[i].second)
        g[i] =
            (g[i] -
             g[j] * calc(A[i].first - A[j].first, A[i].second - A[j].second) %
                 MOD +
             MOD) %
            MOD;
    }
    ans = (ans - g[i] * calc(H - A[i].first - 1, W - A[i].second - 1) % MOD +
           MOD) %
          MOD;
  }
  printf("%I64d\n", ans);
  return 0;
}
