#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e3 + 5, maxv = 2e5 + 5, MOD = 1e9 + 7;
int add(int first, int second) {
  first += second;
  if (first > MOD) first -= MOD;
  return first;
}
int sub(int first, int second) {
  first -= second;
  if (first < 0) first += MOD;
  return first;
}
int mult(long long first, long long second) { return first * second % MOD; }
int pot(int n, int k) {
  if (k == 0) return 1;
  int ret = pot(n, k / 2);
  ret = mult(ret, ret);
  if (k % 2) ret = mult(ret, n);
  return ret;
}
int divide(int first, int second) { return mult(first, pot(second, MOD - 2)); }
int h, w, n;
pair<int, int> P[maxn];
int dp[maxn];
int F[maxv];
int choose(int n, int k) { return divide(F[n], mult(F[n - k], F[k])); }
int cnt(pair<int, int> a, pair<int, int> b) {
  int first = abs(a.first - b.first);
  int second = abs(a.second - b.second);
  return choose(first + second, first);
}
int main() {
  scanf("%d %d %d", &h, &w, &n);
  F[0] = 1;
  for (int i = 1; i < maxv; i++) F[i] = mult(F[i - 1], i);
  P[0] = {1, 1};
  for (int i = 1; i <= n; i++) scanf("%d %d", &P[i].first, &P[i].second);
  P[n + 1] = {h, w};
  sort(P, P + n + 2);
  dp[0] = 1;
  for (int i = 1; i <= n + 1; i++) {
    dp[i] = cnt(P[i], P[0]);
    for (int j = 1; j < i; j++) {
      if (P[j].second > P[i].second) continue;
      dp[i] = sub(dp[i], mult(dp[j], cnt(P[i], P[j])));
    }
  }
  printf("%d\n", dp[n + 1]);
  return 0;
}
