#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10, mod = 1e9 + 7;
pair<int, int> a[N];
long long jc[N], jcinv[N], f[N];
int h, w, n;
long long C(int n, int m) {
  return jc[n] * jcinv[m] % mod * jcinv[n - m] % mod;
}
long long pows(long long a, int b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return ans;
}
int main() {
  jc[0] = 1;
  jcinv[0] = 1;
  for (int i = 1; i < N; i++) {
    jc[i] = jc[i - 1] * i % mod;
    jcinv[i] = pows(jc[i], mod - 2);
  }
  scanf("%d%d%d", &h, &w, &n);
  for (int i = 1; i <= n; i++) scanf("%d%d", &a[i].first, &a[i].second);
  sort(a + 1, a + 1 + n);
  a[n + 1].first = h;
  a[n + 1].second = w;
  for (int i = 1; i <= n + 1; i++) {
    f[i] = C(a[i].first + a[i].second - 2, a[i].first - 1);
    for (int 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;
    }
  }
  printf("%lld", (f[n + 1] + mod) % mod);
  return 0;
}
