#include <bits/stdc++.h>
using namespace std;
int h, w, n;
const long long mod = 1000000007;
pair<int, int> black[2010];
long long fact[201000], dp[2010];
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= mod;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
long long cnk(long long x, long long y) {
  return fact[x + y] * powmod(fact[x] * fact[y], mod - 2) % mod;
}
int main() {
  scanf("%d %d %d", &h, &w, &n);
  fact[0] = 1;
  for (int i = 1; i < 200001; i++) fact[i] = fact[i - 1] * i % mod;
  for (int i = 0; i < n; i++) {
    scanf("%d", &black[i].first);
    scanf("%d", &black[i].second);
  }
  black[n] = make_pair(h, w);
  black[n + 1] = make_pair(1, 1);
  n += 2;
  sort(black, black + n);
  dp[0] = 1;
  for (int i = 1; i < n; i++) {
    dp[i] = cnk(black[i].first - 1, black[i].second - 1);
    for (int j = 1; j < i; j++)
      if (black[j].first <= black[i].first &&
          black[j].second <= black[i].second)
        dp[i] = (dp[i] - cnk(black[i].first - black[j].first,
                             black[i].second - black[j].second) *
                             dp[j]) %
                mod;
  }
  dp[n - 1] = (dp[n - 1] + mod) % mod;
  printf("%I64d\n", dp[n - 1]);
  return 0;
}
