#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int h, w, n;
long long fc[4 * 100005], dp[2009];
pair<long long, long long> p[2009];
long long bigmod(long long a, long long b) {
  if (b == 0) return 1;
  long long x = bigmod(a, b / 2);
  if (b % 2 == 0) return (x * x) % mod;
  return (((x * x) % mod) * a) % mod;
}
long long nm(long long a, long long b) {
  return (fc[a + b] * bigmod(((fc[a] * fc[b]) % mod), mod - 2)) % mod;
}
int main() {
  cin >> h >> w >> n;
  fc[0] = 1;
  for (int i = 1; i <= h + w; i++) fc[i] = (fc[i - 1] * i) % mod;
  for (int i = 1; i <= n; i++) cin >> p[i].first >> p[i].second;
  n++, p[n] = {h, w};
  sort(p + 1, p + 1 + n);
  for (int i = 1; i <= n; i++) {
    dp[i] = nm(p[i].first - 1, p[i].second - 1);
    for (int j = 1; j < i; j++) {
      if (p[i].first >= p[j].first and p[i].second >= p[j].second) {
        dp[i] -=
            ((dp[j] * nm(p[i].first - p[j].first, p[i].second - p[j].second)) %
             mod);
        if (dp[i] < 0) dp[i] += mod;
      }
    }
  }
  cout << dp[n];
}
