#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
const int M = 1e9 + 7;
int h, w, n;
long long fact[N] = {1}, inv[N] = {1}, dp[N];
pair<int, int> p[N];
long long modPow(long long b, int e) {
  long long a = 1;
  while (e) {
    if (e & 1) a = (a * b) % M;
    b = (b * b) % M;
    e >>= 1;
  }
  return a;
}
long long choose(int n, int k) { return fact[n] * inv[k] % M * inv[n - k] % M; }
long long paths(int h1, int w1, int h2, int w2) {
  return choose(w2 - w1 + h2 - h1, w2 - w1);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  for (int i = 1; i < N; ++i) {
    fact[i] = fact[i - 1] * i % M;
    inv[i] = modPow(fact[i], M - 2);
  }
  cin >> h >> w >> n;
  for (int i = 0; i < n; ++i) cin >> p[i].first >> p[i].second;
  p[n].first = h;
  p[n].second = w;
  n++;
  sort(p, p + n);
  n = unique(p, p + n) - p;
  for (int i = 0; i < n; ++i) {
    dp[i] = paths(1, 1, p[i].first, p[i].second);
    for (int j = 0; j < i; ++j)
      if (p[j].first <= p[i].first && p[j].second <= p[i].second)
        dp[i] =
            (dp[i] -
             dp[j] * paths(p[j].first, p[j].second, p[i].first, p[i].second) %
                 M) %
            M;
  }
  cout << (dp[n - 1] + M) % M << endl;
}
