#include <bits/stdc++.h>
const long long maxn = 1e5 + 5;
const long long mod = 1e9 + 7;
long long h, w, n;
long long jc[maxn * 2], jcinv[maxn * 2], dp[maxn];
struct block {
  long long x, y;
  bool operator<(const block &a) const {
    if (x ^ a.x) return x < a.x;
    return y < a.y;
  }
} a[2005];
inline long long power(long long x, long long k) {
  long long res = 1;
  while (k) {
    if (k & 1) (res *= x) %= mod;
    (x *= x) %= mod;
    k >>= 1;
  }
  return res;
}
long long C(long long n, long long m) {
  if (m == 0) return 1;
  return jc[n] * jcinv[m] % mod * jcinv[n - m] % mod;
}
long long lucas(long long n, long long m) {
  if (m == 0) return 1;
  return lucas(n / mod, m / mod) * C(n % mod, m % mod);
}
signed main() {
  std::cin >> h >> w >> n;
  for (long long i = 1; i <= n; ++i) {
    std::cin >> a[i].x >> a[i].y;
  }
  jc[0] = 1;
  jcinv[0] = 1;
  for (long long i = 1; i <= 2e5; ++i) {
    jc[i] = (jc[i - 1] * i) % mod;
    jcinv[i] = power(jc[i], mod - 2);
  }
  std::sort(a + 1, a + n + 1);
  a[n + 1].x = h;
  a[n + 1].y = w;
  for (long long i = 1; i <= n + 1; ++i) {
    dp[i] = lucas(a[i].x + a[i].y - 2, a[i].x - 1);
    for (long long j = 1; j < i; ++j) {
      if (a[j].x <= a[i].x && a[j].y <= a[i].y) {
        dp[i] -=
            dp[j] * lucas(a[i].x - a[j].x + a[i].y - a[j].y, a[i].x - a[j].x);
        dp[i] %= mod;
      }
    }
  }
  std::cout << (dp[n + 1] + mod) % mod;
  return 0;
}
