#include <bits/stdc++.h>
using namespace std;
const int N = 3010;
long long dp[N], l, r, h, w;
const long long mod = 1e9 + 7;
struct point {
  long long x, y;
} p[N];
bool cmp(point a, point b) { return a.x < b.x || (a.x == b.x && a.y < b.y); }
long long qpow(long long a, long long b) {
  long long ans = 1 % mod;
  for (; b; b >>= 1ll) {
    if (b & 1ll) ans = ans * a % mod;
    a = a * a % mod;
  }
  return ans;
}
long long jc[200010], jcinv[200010];
long long inv(long long a) { return qpow(a, mod - 2); }
void init() {
  jc[1] = 1;
  jcinv[1] = inv(1);
  for (int i = 2; i < 200010; i++) {
    jc[i] = jc[i - 1] * i % mod;
    jcinv[i] = inv(jc[i]);
  }
}
long long C(long long m, long long n) {
  if (n == 0)
    return 1;
  else if (n == m)
    return 1;
  return jc[m] * jcinv[n] % mod * jcinv[m - n] % mod;
}
int main() {
  long long n;
  init();
  while (~scanf("%lld%lld%lld", &h, &w, &n)) {
    for (long long i = 1; i <= n; i++) scanf("%lld%lld", &p[i].x, &p[i].y);
    p[n + 1].x = h;
    p[n + 1].y = w;
    sort(p + 1, p + n + 1, cmp);
    for (long long i = 1; i <= n + 1; i++) {
      dp[i] = C(p[i].x + p[i].y - 2, p[i].x - 1);
      for (long long j = 1; j < i; j++) {
        if (p[j].x <= p[i].x && p[j].y <= p[i].y) {
          dp[i] = ((dp[i] - dp[j] * C(p[i].x - p[j].x + p[i].y - p[j].y,
                                      p[i].x - p[j].x)) %
                       mod +
                   mod) %
                  mod;
        }
      }
    }
    cout << dp[n + 1] << endl;
  }
  return 0;
}
