#include <bits/stdc++.h>
using namespace std;
const long long N = 2000 + 5;
const long long M = 1e5 + 5;
const long long P = 1e9 + 7;
long long n, h, w;
long long jc[2 * M + 5], inv[2 * M + 5], f[N];
struct node {
  long long x, y;
} arr[N];
long long cmp(node a, node b);
void pre();
long long C(long long a, long long b);
long long power(long long a, long long b);
int main() {
  scanf("%lld%lld%lld", &h, &w, &n);
  pre();
  for (long long i = 1; i <= n; i++) scanf("%lld%lld", &arr[i].x, &arr[i].y);
  sort(arr + 1, arr + 1 + n, cmp);
  ++n;
  arr[n].x = h, arr[n].y = w;
  for (long long i = 1; i <= n; i++) {
    f[i] = C(arr[i].x + arr[i].y - 2, arr[i].x - 1) % P;
    for (long long j = 1; j < i; j++)
      f[i] += P - f[j] *
                      C(arr[i].x + arr[i].y - arr[j].x - arr[j].y,
                        arr[i].x - arr[j].x) %
                      P,
          f[i] %= P;
  }
  printf("%lld", f[n]);
  return 0;
}
long long power(long long a, long long b) {
  long long ret = 1;
  while (b) {
    if (b & 1LL) ret = ret * a % P;
    b >>= 1LL;
    a = a * a % P;
  }
  return ret;
}
long long C(long long a, long long b) {
  if (a < b) return 0;
  return jc[a] * inv[a - b] % P * inv[b] % P;
}
void pre() {
  long long MX = 2 * max(h, w);
  jc[0] = 1;
  for (long long i = 1; i <= MX; i++) jc[i] = jc[i - 1] * i % P;
  inv[MX] = power(jc[MX], P - 2);
  for (long long i = MX - 1; i >= 0; i--) inv[i] = inv[i + 1] * (i + 1) % P;
}
long long cmp(node a, node b) {
  if (a.x != b.x) return a.x < b.x;
  return a.y < b.y;
}
