#include <bits/stdc++.h>
using namespace std;
long long h, w, n, mod = 1000000007LL;
vector<long long> fakt(200007, 1LL);
long long umocni(long long a, long long b) {
  if (b == 0LL) return 1LL;
  if (b % 2LL == 0LL) {
    long long vv = umocni(a, b / 2LL);
    return (vv * vv) % mod;
  }
  return (a * umocni(a, b - 1LL)) % mod;
}
long long kombi(long long n, long long k) {
  if (k > n || k < 0) return 0LL;
  long long vs = fakt[n];
  vs *= umocni((fakt[k] * fakt[n - k]) % mod, mod - 2LL);
  vs %= mod;
  return vs;
}
int main() {
  for (long long i = 2LL; i < fakt.size(); i++)
    fakt[i] = (fakt[i - 1] * i) % mod;
  cin >> h >> w >> n;
  vector<pair<long long, long long> > V(n + 1);
  for (int i = 0; i < n; i++) cin >> V[i].first >> V[i].second;
  V[n] = make_pair(h, w);
  sort(V.begin(), V.end());
  vector<long long> vs(n + 1, 0LL);
  for (int i = 0; i <= n; i++) {
    vs[i] = kombi(V[i].first + V[i].second - 2LL, V[i].first - 1LL);
    for (int j = 0; j < i; j++) {
      if (V[i].first < V[j].first || V[i].second < V[j].second) continue;
      long long dalej = vs[j];
      dalej *= kombi(V[i].first - V[j].first + V[i].second - V[j].second,
                     V[i].first - V[j].first);
      dalej %= mod;
      vs[i] -= dalej;
      vs[i] %= mod;
      if (vs[i] < 0LL) vs[i] += mod;
    }
  }
  cout << vs[n] << endl;
  return 0;
}
