#include <bits/stdc++.h>
using namespace std;
long long int m = 1e9 + 7, f[200005], inv[200005];
long long int p(long long int a, long long int b) {
  long long int r = 1;
  while (b) {
    if (b & 1) r = (r * a) % m;
    a = (a * a) % m;
    b /= 2;
  }
  return r;
}
long long int ncr(long long int n, long long int r) {
  if (r > n) return 0;
  long long int k = (inv[r] * inv[n - r]) % m;
  k = (f[n] * k) % m;
  return k;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  f[0] = 1;
  for (int i = 1; i <= 200004; i++) f[i] = (f[i - 1] * i) % m;
  inv[200004] = p(f[200004], m - 2);
  for (int i = 200003; i >= 0; i--) inv[i] = (inv[i + 1] * (i + 1)) % m;
  while (t--) {
    int N, M, k;
    long long int ans[2005];
    pair<int, int> p[2005];
    cin >> N >> M >> k;
    for (int i = 0; i <= k - 1; i++) cin >> p[i].first >> p[i].second;
    sort(p, p + k);
    p[k].first = N;
    p[k].second = M;
    for (int i = 0; i <= k; i++)
      ans[i] = ncr(p[i].first + p[i].second - 2, p[i].first - 1);
    for (int i = 0; i <= k - 1; i++) {
      for (int j = i + 1; j <= k; j++) {
        ans[j] -=
            (ans[i] * ncr(p[j].first + p[j].second - p[i].first - p[i].second,
                          p[j].first - p[i].first)) %
            m;
        ans[j] %= m;
        if (ans[j] < 0) ans[j] += m;
      }
    }
    cout << ans[k];
    cout << "\n";
  }
  return 0;
}
