#include <bits/stdc++.h>
using namespace std;
const int N = 2100, M = 1e6 + 233, MOD = 1e9 + 7;
int h, w, n;
struct Point {
  int x, y;
} p[2100];
bool comp(const Point &p1, const Point &p2) {
  if (p1.x == p2.x) return p1.y < p2.y;
  return p1.x < p2.x;
}
long long jc[M], ny[M], f[N];
long long fpow(long long x, long long y) {
  long long xx = x % MOD, ret = 1;
  for (; y; y >>= 1) {
    if (y & 1) ret = ret * xx % MOD;
    xx = xx * xx % MOD;
  }
  return ret;
}
void read() {
  cin >> h >> w >> n;
  for (int i = 1; i <= n; ++i) cin >> p[i].x >> p[i].y;
  p[++n].x = h;
  p[n].y = w;
  sort(p + 1, p + n + 1, comp);
}
void init() {
  jc[0] = 1;
  for (int i = 1; i < M; ++i) jc[i] = jc[i - 1] * i % MOD;
  ny[M - 1] = fpow(jc[M - 1], MOD - 2);
  for (int i = M - 2; i >= 0; --i) ny[i] = (i + 1) * ny[i + 1] % MOD;
}
long long C(int n, int m) { return jc[n] * ny[m] % MOD * ny[n - m] % MOD; }
void dp() {
  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].y <= p[i].y) {
        int x = p[i].x - p[j].x, y = p[i].y - p[j].y;
        f[i] -= f[j] * C(x + y, x) % MOD;
        f[i] = (f[i] % MOD + MOD) % MOD;
      }
    }
  }
  cout << f[n] << endl;
}
int main() {
  read();
  init();
  dp();
  return 0;
}
