#include <bits/stdc++.h>
using namespace std;
long long power(long long x, long long y, long long p) {
  long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
long long modInverse(long long a, long long p) { return power(a, p - 2, p); }
long long fac[200001], ifac[200001];
long long C(int n, int k) {
  long long ans = fac[n];
  ans = (ans * ifac[k]) % 1000000007;
  return ans = (ans * ifac[n - k]) % 1000000007;
}
int main() {
  fac[0] = 1;
  ifac[0] = 1;
  long long h, w, n;
  long long x, y;
  cin >> h >> w >> n;
  vector<pair<long long, long long>> black;
  for (int i = 0; i < (n); ++i) {
    cin >> x >> y;
    black.push_back(make_pair(x, y));
  }
  sort(black.begin(), black.end());
  for (int i = (1); i < (200001); ++i) {
    fac[i] = (fac[i - 1] * 1ll * i) % 1000000007;
    ifac[i] = (ifac[i - 1] * 1ll * modInverse(i, 1000000007)) % 1000000007;
  }
  long long dp[n], x_prev, y_prev, ans;
  memset(dp, 0, n);
  ans = C(h - 2 + w, h - 1);
  for (int i = 0; i < (n); ++i) {
    x = black[i].first;
    y = black[i].second;
    dp[i] = C(x + y - 2, x - 1);
    for (int j = 0; j < (i); ++j) {
      x_prev = black[j].first;
      y_prev = black[j].second;
      if (y_prev <= y) {
        dp[i] = dp[i] - (dp[j] * 1ll * C(x + y - x_prev - y_prev, x - x_prev));
        dp[i] = (dp[i] + 1000000007) % 1000000007;
      }
    }
    ans = (ans - dp[i] * 1ll * C(h - x + w - y, h - x)) % 1000000007;
  }
  cout << (ans + 1000000007) % 1000000007;
  return 0;
}
