#include <bits/stdc++.h>
using namespace std;
const int nax = 2e5 + 5;
const int mod = 1e9 + 7;
pair<int, int> P[2005];
long long dp[2005], fac[nax], inv_fac[nax];
int h, w, n;
long long nCk(long long n, long long k) {
  return ((fac[n] * inv_fac[n - k]) % mod * inv_fac[k]) % mod;
}
long long solve(int cur) {
  if (dp[cur] != -1) return dp[cur];
  long long res = nCk(h - P[cur].first + w - P[cur].second, h - P[cur].first);
  for (int i = 0; i <= n; i++)
    if (i != cur && P[i].first >= P[cur].first &&
        P[i].second >= P[cur].second) {
      long long dr = P[i].first - P[cur].first,
                dc = P[i].second - P[cur].second;
      res = (res - (nCk(dr + dc, dc) * solve(i)) % mod + mod) % mod;
    }
  return dp[cur] = res;
}
void egcd(long long a, long long b, long long& x, long long& y) {
  if (b == 0) {
    x = 1, y = 0;
  } else {
    egcd(b, a % b, x, y);
    x -= a / b * y;
    swap(x, y);
  }
}
long long inv_mod(long long a) {
  long long x, y;
  egcd(a, mod, x, y);
  return (x % mod + mod) % mod;
}
int main() {
  cin >> h >> w >> n;
  fill(dp, dp + n + 1, -1);
  P[0].first = P[0].second = 1;
  for (int i = 1; i <= n; i++) cin >> P[i].first >> P[i].second;
  fac[0] = inv_fac[0] = 1;
  for (int i = 1; i <= h + w; i++) fac[i] = (i * fac[i - 1]) % mod;
  for (int i = 1; i <= h + w; i++) inv_fac[i] = inv_mod(fac[i]);
  cout << solve(0) << endl;
  return 0;
}
