#include <bits/stdc++.h>
using namespace std;
const int N = 2005, M = 200005;
struct node {
  int x, y;
} d[N];
int h, w, n, mod = 1e9 + 7;
long long c[M] = {1, 1}, inv[M] = {1, 1}, ni[M] = {1, 1}, f[N];
long long quick_mod(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % mod;
    b >>= 1;
    a = a * a % mod;
  }
  return ans;
}
void init() {
  for (int i = 2; i < M; i++) {
    c[i] = c[i - 1] * i % mod;
    ni[i] = (mod - mod / i) * ni[mod % i] % mod;
    inv[i] = ni[i] * inv[i - 1] % mod;
  }
}
long long C(int n, int m) {
  if (n < m) return 0;
  if (n == m || m == 0) return 1;
  return c[n] * inv[m] % mod * inv[n - m] % mod;
}
bool cmp(node a, node b) {
  if (a.x != b.x) return a.x < b.x;
  return a.y < b.y;
}
int main() {
  init();
  scanf("%d%d%d", &h, &w, &n);
  for (int i = 0; i < n; i++) scanf("%d%d", &d[i].x, &d[i].y);
  sort(d, d + n, cmp);
  d[n].x = h;
  d[n].y = w;
  for (int i = 0; i <= n; i++) {
    f[i] = C(d[i].x + d[i].y - 2, d[i].x - 1);
    for (int j = 0; j < i; j++) {
      if (d[j].x > d[i].x || d[j].y > d[i].y) continue;
      f[i] = (f[i] -
              f[j] * C(d[i].x - d[j].x + d[i].y - d[j].y, d[i].x - d[j].x)) %
             mod;
    }
    f[i] = (f[i] + mod) % mod;
  }
  printf("%lld\n", f[n]);
  return 0;
}
