#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
pair<long long, long long> a[2010];
long long h, w, n, f[2010], jc[200010], jcinv[200010];
long long C(long long n, long long m) {
  return jc[n] * jcinv[m] % MOD * jcinv[n - m] % MOD;
}
long long power(long long a, long long b) {
  long long c = 1;
  for (; b; b >>= 1) {
    if (b & 1) c = c * a % MOD;
    a = a * a % MOD;
  }
  return c;
}
int main() {
  jc[0] = 1;
  jcinv[0] = 1;
  for (long long i = 1; i <= 200000; i++) {
    jc[i] = jc[i - 1] * i % MOD;
    jcinv[i] = power(jc[i], MOD - 2);
  }
  cin >> h >> w >> n;
  for (long long i = 1; i <= n; i++)
    scanf("%lld %lld", &a[i].first, &a[i].second);
  sort(a + 1, a + 1 + n);
  a[n + 1].first = h;
  a[n + 1].second = w;
  for (long long i = 1; i <= n + 1; i++) {
    f[i] = C(a[i].first + a[i].second - 2, a[i].first - 1);
    for (long long j = 1; j < i; j++) {
      if (a[j].first > a[i].first || a[j].second > a[i].second) continue;
      f[i] =
          (f[i] - f[j] * C(a[i].first + a[i].second - a[j].first - a[j].second,
                           a[i].first - a[j].first)) %
          MOD;
    }
  }
  cout << (f[n + 1] + MOD) % MOD << endl;
  return 0;
}
