#include <bits/stdc++.h>
using namespace std;
const int N = 2e3 + 5, mod = 1e9 + 7;
int h, w, n;
long long fac[200005], inv[200005], f[N];
struct node {
  int x, y;
} p[N];
void prework() {
  fac[0] = inv[0] = inv[1] = 1;
  for (int i = 1; i <= h + w; i++) fac[i] = fac[i - 1] * i % mod;
  for (int i = 2; i <= h + w; i++)
    inv[i] = (mod - mod / i) * inv[mod % i] % mod;
  for (int i = 2; i <= h + w; i++) inv[i] = inv[i - 1] * inv[i] % mod;
}
bool cmp(node a, node b) { return a.x == b.x ? a.y < b.y : a.x < b.x; }
long long C(long long n, long long m) {
  return fac[n] * inv[m] % mod * inv[n - m] % mod;
}
int main() {
  cin >> h >> w >> n;
  prework();
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &p[i].x, &p[i].y);
  }
  p[++n] = (node){h, w};
  sort(p + 1, p + n + 1, cmp);
  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 - 1; j++) {
      if (p[j].x <= p[i].x && p[j].y <= p[i].y) {
        f[i] = (f[i] -
                f[j] * C(p[i].x - p[j].x + p[i].y - p[j].y, p[i].x - p[j].x) %
                    mod +
                mod) %
               mod;
      }
    }
  }
  printf("%lld\n", f[n]);
  return 0;
}
