#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int N = 2e5 + 5;
inline long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 1) + (x << 3) + ch - '0';
    ch = getchar();
  }
  return x * f;
}
inline long long pow(long long a, long long b) {
  long long res = 1;
  for (; b; b >>= 1, a = (long long)a * a % mod)
    if (b & 1) res = res * a % mod;
  return res;
}
long long fac[N], ifac[N];
inline void init() {
  fac[0] = 1;
  const int Max = 2e5;
  for (int i = 1; i <= Max; ++i) fac[i] = fac[i - 1] * i % mod;
  ifac[Max] = pow(fac[Max], mod - 2);
  for (int i = Max - 1; i >= 0; --i) ifac[i] = ifac[i + 1] * (i + 1) % mod;
}
inline long long C(long long n, long long m) {
  return (long long)fac[n] * ifac[m] % mod * ifac[n - m] % mod;
}
struct poi {
  long long x, y;
  poi() {}
  poi(long long _x, long long _y) : x(_x), y(_y) {}
  bool operator<(const poi &z) const { return x ^ z.x ? x < z.x : y < z.y; }
} p[N];
long long F[N];
int main() {
  init();
  long long h = read(), w = read(), n = read();
  for (int i = 1; i <= n; ++i) p[i].x = read(), p[i].y = read();
  sort(p + 1, p + n + 1);
  long long ans = C(h + w - 2, h - 1);
  for (int i = 1; i <= n; ++i) {
    F[i] = C(p[i].x + p[i].y - 2, p[i].x - 1);
    for (int j = 1; j < i; ++j) {
      if (p[j].x <= p[i].x && p[j].y <= p[i].y) {
        F[i] = (F[i] -
                F[j] * C(p[i].x - p[j].x + p[i].y - p[j].y, p[i].x - p[j].x) %
                    mod +
                mod) %
               mod;
      }
    }
  }
  for (int i = 1; i <= n; ++i)
    ans =
        (ans - F[i] * C(h - p[i].x + w - p[i].y, h - p[i].x) % mod + mod) % mod;
  cout << ans << endl;
}
