#include <bits/stdc++.h>
using namespace std;
const long long N = 2009, M = 1e5 + 9, MOD = 1e9 + 7;
struct Point {
  long long x, y;
} a[N];
long long h, w, n;
long long fac[M << 1], inv[M << 1], invfac[M << 1];
long long f[N];
template <typename T>
inline void read(T &x) {
  x = 0;
  T w = 1;
  char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') w = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    x = (x << 3) + (x << 1) + c - '0';
    c = getchar();
  }
  x *= w;
}
bool cmp(const Point &a, const Point &b) {
  if (a.x == b.x) return a.y < b.y;
  return a.x < b.x;
}
void init() {
  fac[0] = 1;
  for (long long i = 1; i < (M << 1); ++i) fac[i] = fac[i - 1] * i % MOD;
  inv[1] = 1;
  for (long long i = 2; i < (M << 1); ++i)
    inv[i] = MOD - MOD / i * inv[MOD % i] % MOD;
  invfac[0] = 1;
  for (long long i = 1; i < (M << 1); ++i)
    invfac[i] = invfac[i - 1] * inv[i] % MOD;
}
long long C(long long n, long long m) {
  return fac[n] * invfac[m] % MOD * invfac[n - m] % MOD;
}
int main() {
  read(h);
  read(w);
  read(n);
  init();
  for (long long i = 1; i <= n; ++i) read(a[i].x), read(a[i].y);
  a[n + 1] = (Point){h, w};
  sort(a + 1, a + n + 2, cmp);
  f[0] = 1;
  for (long long i = 1; i <= n + 1; ++i) {
    f[i] = C(a[i].x + a[i].y - 2, a[i].x - 1);
    for (long long j = 1; j <= i - 1; ++j)
      if (a[j].x <= a[i].x && a[j].y <= a[i].y)
        f[i] = (f[i] -
                f[j] * C(a[i].x + a[i].y - a[j].x - a[j].y, a[i].x - a[j].x) %
                    MOD +
                MOD) %
               MOD;
  }
  printf("%lld", f[n + 1]);
  return 0;
}
