#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const int maxn = 2000;
const int maxm = 100000;
struct Node {
  int x, y;
} pos[maxn + 5];
int h, w, n;
long long jc_inv[2 * maxm + 5] = {1}, jc[2 * maxm + 5] = {1};
long long f[maxn + 5];
bool cmp(const Node &x, const Node &y) {
  if (x.x == y.x) return x.y < y.y;
  return x.x < y.x;
}
inline long long qpow(long long a, int b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = (res * a) % mod;
    b >>= 1;
    a = (a * a) % mod;
  }
  return res;
}
void init() {
  for (int i = 1; i <= w + h; i++) {
    jc[i] = jc[i - 1] * i % mod;
    jc_inv[i] = jc_inv[i - 1] * qpow(i, mod - 2) % mod;
  }
  return;
}
inline long long C(int a, int b) {
  return jc[a] * jc_inv[b] % mod * jc_inv[a - b] % mod;
}
int main() {
  scanf("%d %d %d", &h, &w, &n);
  for (int i = 1; i <= n; i++) scanf("%d %d", &pos[i].x, &pos[i].y);
  sort(pos + 1, pos + 1 + n, cmp);
  init();
  pos[n + 1].x = h;
  pos[n + 1].y = w;
  for (int i = 1; i <= n + 1; i++) {
    f[i] = C(pos[i].x + pos[i].y - 2, pos[i].x - 1);
    for (int j = 1; j < i; j++) {
      if (pos[j].y > pos[i].y || pos[j].x > pos[i].x) continue;
      f[i] = (f[i] - f[j] * C(pos[i].x - pos[j].x + pos[i].y - pos[j].y,
                              pos[i].x - pos[j].x)) %
             mod;
    }
  }
  printf("%d\n", (f[n + 1] + mod) % mod);
  return 0;
}
