#include <bits/stdc++.h>
using namespace std;
const long long MODD = 1e9 + 7;
int h, w, n;
pair<int, int> a[2010];
long long f[2010], fact[200010];
void init() {
  fact[0] = fact[1] = 1;
  for (int i = 2; i <= 200000; ++i) fact[i] = fact[i - 1] * i % MODD;
}
long long myPow(long long a, long long b) {
  if (!b) return 1;
  long long tmp = myPow(a, b >> 1);
  tmp = tmp * tmp % MODD;
  if (b & 1) tmp = tmp * a % MODD;
  return tmp;
}
long long C(long long a, long long b) {
  long long nume = fact[a] * fact[b - a] % MODD;
  return fact[b] * myPow(nume, MODD - 2) % MODD;
}
int main() {
  init();
  scanf("%d %d %d", &h, &w, &n);
  for (int i = 0; i < n; ++i) scanf("%d %d", &a[i].first, &a[i].second);
  a[n].first = h;
  a[n].second = w;
  sort(a, a + n + 1);
  for (int i = 0; i <= n; ++i) {
    f[i] = C(a[i].first - 1, a[i].first + a[i].second - 2);
    for (int j = 0; j < i; ++j)
      if (a[j].first <= a[i].first && a[j].second <= a[i].second) {
        f[i] -= f[j] *
                C(a[i].first - a[j].first,
                  a[i].first - a[j].first + a[i].second - a[j].second) %
                MODD;
        f[i] = (f[i] + MODD) % MODD;
      }
  }
  printf("%lld", f[n]);
  return 0;
}
