#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
long long int f[2000005];
long long int modpow(long long int a, long long int b) {
  long long int ans = 1;
  while (b) {
    if (b & 1) ans = (ans * a) % mod;
    b >>= 1ll;
    a = (a * a) % mod;
  }
  return ans % mod;
}
long long int inv(long long int a) { return modpow(a, mod - 2) % mod; }
long long int ncr(long long int n, long long int r) {
  if (r > n) return 0;
  if (n == r || r == 0) return 1ll;
  return (f[n] * (inv((f[r] * f[n - r]) % mod)) % mod) % mod;
}
void pre() {
  f[0] = 1ll;
  for (int i = 1; i < 2000005; i++) {
    f[i] = (1ll * i * f[i - 1]) % mod;
  }
}
bool cmp(pair<int, int> &a, pair<int, int> &b) {
  if (a.second == b.second) return a.first < b.first;
  return a.second < b.second;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int h, w, n;
  cin >> h >> w >> n;
  vector<pair<int, int> > a(n);
  for (int i = 0; i < n; i++) cin >> a[i].first >> a[i].second;
  a.push_back({h, w});
  sort(a.begin(), a.end());
  vector<long long int> dp(n + 1);
  pre();
  for (int i = 0; i <= n; i++) {
    dp[i] = ncr(a[i].first + a[i].second - 2, a[i].first - 1);
    for (int j = 0; j < i; j++) {
      if (a[j].second <= a[i].second && a[j].first <= a[i].first) {
        long long int caminos =
            ncr(a[i].first - a[j].first + a[i].second - a[j].second,
                a[i].first - a[j].first) %
            mod;
        caminos = (caminos * dp[j]) % mod;
        dp[i] = (dp[i] + mod - caminos) % mod;
        dp[i] %= mod;
      }
    }
  }
  cout << dp[n] << '\n';
  return 0;
}
