#include <bits/stdc++.h>
using namespace std;
int h, w, n;
long long fac[200005];
long long dp[2222];
int mod = 1000000007;
pair<int, int> p[2222];
long long pw(long long a, long long p) {
  if (!p) return 1;
  if (p & 1) return pw(a, p - 1) * a % mod;
  long long z = pw(a, p >> 1);
  return z * z % mod;
}
long long rev(long long x) { return pw(x, mod - 2); }
long long C(int x, int y) {
  return fac[x + y] * rev(fac[x] * fac[y] % mod) % mod;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> h >> w >> n;
  fac[0] = 1;
  for (int(i) = (1); i < (200005); ++(i)) fac[i] = fac[i - 1] * i % mod;
  for (int(i) = (0); i < (n); ++(i)) {
    cin >> p[i].first >> p[i].second;
    --p[i].first;
    --p[i].second;
  }
  p[n] = {h - 1, w - 1};
  ++n;
  p[n] = {0, 0};
  ++n;
  sort(p, p + n);
  dp[0] = 1;
  for (int(i) = (1); i < (n); ++(i)) {
    dp[i] = C(p[i].first, p[i].second);
    for (int(j) = (1); j < (i); ++(j))
      if (p[i].first >= p[j].first && p[i].second >= p[j].second) {
        dp[i] -=
            dp[j] * C(p[i].first - p[j].first, p[i].second - p[j].second) % mod;
        dp[i] += mod;
        dp[i] %= mod;
      }
  }
  cout << (dp[n - 1] + mod) % mod;
  return 0;
}
