#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007LL;
inline long long max(long long a, int32_t b) { return a > b ? a : b; }
inline long long max(int32_t a, long long b) { return a > b ? a : b; }
inline long long min(long long a, int32_t b) { return a < b ? a : b; }
inline long long min(int32_t a, long long b) { return a < b ? a : b; }
long long d4_1[4] = {1, 0, -1, 0};
long long d4_2[4] = {0, 1, 0, -1};
long long d8_1[8] = {1, 1, 1, -1, -1, -1, 0, 0};
long long d8_2[8] = {0, -1, 1, 0, -1, 1, 1, -1};
long long seed;
mt19937 rng(seed = chrono::steady_clock::now().time_since_epoch().count());
inline long long rand(long long l = 0, long long r = 1e18) {
  return uniform_int_distribution<long long>(l, r)(rng);
}
long long power(long long a, long long b) {
  long long result = 1;
  while (b) {
    if (b & 1) result = (result * a) % mod;
    a = (a * a) % mod;
    b /= 2;
  }
  return result;
}
long long fact[200005];
long long inv[200005];
void compute() {
  fact[0] = 1;
  for (long long i = 1; i < 200005; i++) fact[i] = (fact[i - 1] * i) % mod;
  inv[200003] = power(fact[200003], mod - 2);
  for (long long i = 200002; i >= 0; i--) {
    inv[i] = ((i + 1) * inv[i + 1]) % mod;
  }
}
long long ncr(long long x, long long y) {
  if (y < 0 || y > x || x < 0) return 0;
  long long z = (inv[x - y] * inv[y]) % mod;
  return (fact[x] * z) % mod;
}
bool mycomp(pair<long long, long long> a, pair<long long, long long> b) {
  if (a.first == b.first) return a.second < b.second;
  return a.first < b.first;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cout << fixed << setprecision(10);
  long long t = 1;
  compute();
  while (t--) {
    long long h, w;
    cin >> h >> w;
    long long k;
    cin >> k;
    pair<long long, long long> p[k + 5];
    for (long long i = 0; i < k; i++) cin >> p[i].first >> p[i].second;
    p[k].first = h;
    p[k].second = w;
    sort(p, p + k, mycomp);
    long long dp[2005];
    for (long long i = 0; i <= k; i++) {
      long long x = ncr(p[i].first + p[i].second - 2, p[i].first - 1);
      for (long long j = i - 1; j >= 0; j--) {
        long long y =
            (dp[j]) * (ncr(p[i].first + p[i].second - p[j].first - p[j].second,
                           p[i].first - p[j].first));
        y %= mod;
        x -= y;
        if (x < 0) x += mod;
      }
      dp[i] = x;
    }
    cout << dp[k];
  }
}
