#include <bits/stdc++.h>
using namespace std;
const long long Mod = 1e9 + 7;
struct point {
  long long x, y;
} pt[2001];
long long h, w, n, ans, fact[200001], inv[200001], f[2001];
bool cmp(point a, point b) {
  if (a.x == b.x) return a.y < b.y;
  return a.x < b.x;
}
long long power(long long a, long long b, long long p) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % p;
    a = a * a % p;
    b >>= 1;
  }
  return ans;
}
void pre(long long n) {
  fact[0] = 1;
  for (long long i = 1; i <= n; i++) fact[i] = fact[i - 1] * i % Mod;
  inv[n] = power(fact[n], Mod - 2, Mod);
  for (long long i = n - 1; i >= 0; i--) inv[i] = inv[i + 1] * (i + 1) % Mod;
}
long long C(long long n, long long m) {
  if (n == m) return 1;
  return fact[n] * inv[m] % Mod * inv[n - m] % Mod;
}
signed main() {
  scanf("%lld%lld%lld", &h, &w, &n);
  for (long long i = 1; i <= n; i++) scanf("%lld%lld", &pt[i].x, &pt[i].y);
  pre(200000);
  pt[n + 1].x = h, pt[n + 1].y = w;
  sort(pt + 1, pt + 2 + n, cmp);
  for (long long i = 1; i <= n + 1; i++) {
    f[i] = C(pt[i].x + pt[i].y - 2, pt[i].x - 1);
    for (long long j = 1; j < i; j++)
      if (pt[i].x >= pt[j].x && pt[i].y >= pt[j].y)
        f[i] =
            (f[i] -
             (long long)f[j] *
                 C(pt[i].y - pt[j].y + pt[i].x - pt[j].x, pt[i].x - pt[j].x) %
                 Mod +
             Mod) %
            Mod;
  }
  printf("%lld", f[n + 1]);
  return 0;
}
