#include <bits/stdc++.h>
using namespace std;
const int N = 2010, M = 3e5 + 10, mod = 1e9 + 7;
pair<int, int> p[N];
long long fact[M], rfact[M], dp[N];
long long po(int a, int b) {
  if (b == 1) return a;
  long long c = po(a, b / 2);
  if (b % 2 == 1) return c * c % mod * a % mod;
  return c * c % mod;
}
long long chs(int x1, int x2) {
  return fact[x2] * rfact[x2 - x1] % mod * rfact[x1] % mod;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int h, w, n;
  cin >> h >> w >> n;
  for (int i = 0; i < n; i++) cin >> p[i].first >> p[i].second;
  p[n] = make_pair(h, w);
  n++;
  sort(p, p + n);
  fact[0] = 1;
  rfact[0] = 1;
  for (int i = 1; i < M; i++) {
    fact[i] = fact[i - 1] * i % mod;
    rfact[i] = po(fact[i], mod - 2);
  }
  for (int i = 0; i < n; i++) {
    dp[i] = chs(p[i].first - 1, p[i].first + p[i].second - 2);
    for (int j = 0; j < i; j++) {
      if (p[j].second > p[i].second) continue;
      dp[i] = (dp[i] -
               dp[j] *
                   chs(p[i].first - p[j].first,
                       p[i].first + p[i].second - p[j].first - p[j].second) %
                   mod +
               mod) %
              mod;
    }
  }
  cout << dp[n - 1];
  return 0;
}
