#include <bits/stdc++.h>
#pragma GCC optimize("O2")
using namespace std;
long long const inf = 1e18, linf = 2e9, mod = 1e9 + 7;
int const mxn = 2e5 + 10;
long long poww(long long a, long long b, long long md = mod) {
  return (!b ? 1
             : (b & 1 ? a * poww(a * a % md, b / 2, md) % md
                      : poww(a * a % md, b / 2, md) % md));
}
long long fact[mxn], dp[mxn], pf[mxn];
vector<pair<int, int> > bl;
void prepro() {
  fact[0] = 1;
  for (int i = 1; i < mxn; i++) {
    fact[i] = (fact[i - 1] * i) % mod;
  }
  for (int i = 0; i < mxn; i++) {
    pf[i] = poww(fact[i], mod - 2) % mod;
  }
}
long long ent(int k, int n) {
  if (k > n or k < 0) return 0;
  return (fact[n] * pf[k] % mod * pf[n - k] % mod) % mod;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  prepro();
  int h, w, n;
  cin >> h >> w >> n;
  for (int i = 0; i < n; i++) {
    int a, b;
    cin >> a >> b;
    bl.push_back({a, b});
  }
  bl.push_back({h, w});
  sort(bl.begin(), bl.end());
  for (int i = 0; i <= n; i++) {
    dp[i] = ent(bl[i].first - 1, bl[i].first + bl[i].second - 2);
    for (int j = 0; j < i; j++) {
      dp[i] -= dp[j] *
               (ent(bl[i].first - bl[j].first,
                    bl[i].first + bl[i].second - bl[j].first - bl[j].second)) %
               mod;
      dp[i] += mod;
      dp[i] %= mod;
    }
  }
  cout << dp[n];
}
