#include <bits/stdc++.h>
using namespace std;
const int N = 2e3 + 100;
long long h, w;
int n;
struct point {
  long long x, y;
  bool operator<(const point &a) const {
    return (x == a.x) ? y < a.y : x < a.x;
  }
} q[N];
const long long mod = 1e9 + 7;
const int M = 2e5 + 100;
long long jc[M], jcinv[M];
long long qpow(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return ans;
}
long long C(long long n, long long m) {
  return (jc[n] * jcinv[n - m]) % mod * jcinv[m] % mod;
}
long long f[N];
int main() {
  jc[0] = 1;
  jcinv[0] = 1;
  for (int i = 1; i < M; i++) jc[i] = jc[i - 1] * 1ll * i % mod;
  jcinv[M - 1] = qpow(jc[M - 1], mod - 2);
  for (int i = M - 2; i >= 1; i--)
    jcinv[i] = jcinv[i + 1] * 1ll * (i + 1) % mod;
  scanf("%lld%lld%d", &h, &w, &n);
  for (int i = 1; i <= n; i++) {
    scanf("%lld%lld", &q[i].x, &q[i].y);
  }
  sort(q + 1, q + 1 + n);
  q[n + 1] = (point){h, w};
  for (int i = 1; i <= n + 1; i++) {
    f[i] = C(q[i].x + q[i].y - 2, q[i].x - 1);
    for (int j = 1; j < i; j++) {
      if (q[j].x <= q[i].x && q[j].y <= q[i].y)
        f[i] = (f[i] -
                (f[j] * C(q[i].x - q[j].x + q[i].y - q[j].y, q[i].x - q[j].x)) %
                    mod +
                mod) %
               mod;
    }
  }
  printf("%lld\n", f[n + 1]);
  return 0;
}
