#include <bits/stdc++.h>
using namespace std;
using LL = long long;
const int N = 2005, MOD = (int)1e9 + 7, L = (int)2e5;
struct P {
  int x, y;
  bool operator<(const P &r) const {
    if (x == r.x) return y < r.y;
    return x < r.x;
  }
} ps[N];
int w, h, n, dp1[N], fac[L + 1], rfac[L + 1];
int rpow(int a) {
  int b = 1;
  for (int m = MOD - 2; m; m >>= 1, a = (LL)a * a % MOD) {
    if (m & 1) b = (LL)b * a % MOD;
  }
  return b;
}
int main() {
  scanf("%d%d%d", &h, &w, &n);
  for (int i = 1; i <= n; i++) scanf("%d%d", &ps[i].x, &ps[i].y);
  fac[0] = rfac[0] = 1;
  for (int i = 1; i <= L; i++) {
    fac[i] = (LL)i * fac[i - 1] % MOD;
    rfac[i] = rpow(fac[i]);
  }
  ps[++n] = {h, w};
  sort(ps + 1, ps + n + 1);
  dp1[0] = 1;
  for (int i = 1; i <= n; i++) {
    int x = ps[i].x, y = ps[i].y,
        base = (LL)fac[y + x - 2] * rfac[x - 1] % MOD * rfac[y - 1] % MOD;
    for (int j = 1; j < i; j++) {
      if (ps[j].y <= ps[i].y) {
        int ox = ps[j].x, oy = ps[j].y;
        base += (MOD - (LL)dp1[j] * fac[y - oy + x - ox] % MOD * rfac[x - ox] %
                           MOD * rfac[y - oy] % MOD);
        base %= MOD;
      }
    }
    dp1[i] = base;
  }
  printf("%d\n", dp1[n]);
}
