#include <bits/stdc++.h>
using namespace std;
int const MOD = 1e9 + 7;
long long fac[200005], dp[2005], inv[200005];
int h, w, n;
struct Point {
  int x, y;
} p[2005];
bool cmp(Point a, Point b) {
  if (a.x == b.x) return a.y < b.y;
  return a.x < b.x;
}
long long get_inv(long long x) {
  long long res = 1, y = MOD - 2;
  while (y) {
    if (y & 1) res = (res * x) % MOD;
    x = (x * x) % MOD;
    y >>= 1;
  }
  return res;
}
void pre() {
  fac[0] = 1;
  inv[0] = 1;
  for (int i = 1; i <= 200005; i++) {
    fac[i] = (fac[i - 1] * i) % MOD;
    inv[i] = get_inv(fac[i]);
  }
}
long long C(int n, int m) { return fac[n] * inv[m] % MOD * inv[n - m] % MOD; }
int main() {
  pre();
  scanf("%d %d %d", &h, &w, &n);
  for (int i = 1; i <= n; i++) scanf("%d %d", &p[i].x, &p[i].y);
  p[++n].x = h;
  p[n].y = w;
  sort(p + 1, p + n + 1, cmp);
  for (int i = 1; i <= n; i++) {
    dp[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)
        dp[i] = (dp[i] % MOD + MOD -
                 dp[j] * C(p[i].x - p[j].x + p[i].y - p[j].y, p[i].x - p[j].x) %
                     MOD) %
                MOD;
  }
  printf("%I64d\n", dp[n]);
}
