#include <bits/stdc++.h>
using namespace std;
const int maxN = (int)2e3 + 10;
const int maxT = (int)2e5 + 10;
const int mod = (int)1e9 + 7;
vector<pair<int, int> > pt;
long long fact[maxT];
long long inv[maxT];
long long binpow(long long x, int n) {
  long long res = 1ll;
  while (n != 0) {
    if (n % 2 == 1) {
      res = (res * x) % mod;
    }
    x = (x * x) % mod;
    n /= 2;
  }
  return res;
}
void precalc() {
  fact[0] = 1;
  inv[0] = 1;
  for (int i = 1; i < maxT; ++i) {
    fact[i] = (fact[i - 1] * i) % mod;
    inv[i] = binpow(fact[i], mod - 2);
  }
}
long long C(int k, int n) {
  if (n < 0 || k < 0 || k > n) return 0LL;
  long long res = fact[n];
  res = (res * inv[k]) % mod;
  res = (res * inv[n - k]) % mod;
  return res;
}
long long calc(int x, int y) { return C(x - 1, x + y - 2); }
long long f[maxN];
int main() {
  precalc();
  int h, w;
  scanf("%d%d", &h, &w);
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    int x, y;
    scanf("%d%d", &x, &y);
    pt.push_back(make_pair(x, y));
  }
  pt.push_back(make_pair(h, w));
  sort(pt.begin(), pt.end());
  for (size_t i = 0; i < pt.size(); ++i) {
    long long sum = 0LL;
    for (size_t j = 0; j < i; ++j) {
      long long val = f[j];
      val = (val * calc(pt[i].first - pt[j].first + 1,
                        pt[i].second - pt[j].second + 1)) %
            mod;
      sum = (sum + val) % mod;
    }
    f[i] = (calc(pt[i].first, pt[i].second) - sum + mod) % mod;
  }
  printf("%I64d\n", f[(int)pt.size() - 1]);
  return 0;
}
