#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int maxn = 2010;
const int maxm = 2e5 + 10;
int h, w, n;
int fac[maxm], inv[maxm];
int f[maxn];
struct num {
  int x, y;
} bk[maxn];
bool cmp(num a, num b) {
  if (a.x == b.x)
    return a.y < b.y;
  else
    return a.x < b.x;
}
template <typename Tp>
void read(Tp &x) {
  x = 0;
  int f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  x *= f;
}
int qpow(int a, int b) {
  int ans = 1;
  for (; b; b >>= 1) {
    if (b & 1) ans = (long long)ans * a % mod;
    a = (long long)a * a % mod;
  }
  return ans;
}
int C(int n, int m) {
  if (m > n) return 0;
  return (long long)fac[n] * inv[m] % mod * inv[n - m] % mod;
}
int main() {
  read(h), read(w), read(n);
  fac[0] = 1;
  for (int i = 1; i <= h + w; i++) fac[i] = (long long)fac[i - 1] * i % mod;
  inv[h + w] = qpow(fac[h + w], mod - 2);
  for (int i = h + w - 1; i >= 0; i--)
    inv[i] = (long long)inv[i + 1] * (i + 1) % mod;
  for (int i = 1; i <= n; i++) read(bk[i].x), read(bk[i].y);
  sort(bk + 1, bk + n + 1, cmp);
  bk[n + 1].x = h, bk[n + 1].y = w;
  for (int i = 1; i <= n + 1; i++) {
    f[i] = C(bk[i].x + bk[i].y - 2, bk[i].x - 1);
    for (int j = 1; j < i; j++) {
      if (bk[j].x <= bk[i].x && bk[j].y <= bk[i].y) {
        int cx = bk[i].x - bk[j].x, cy = bk[i].y - bk[j].y;
        f[i] = ((f[i] - (long long)C(cx + cy, cx) * f[j] % mod) + mod) % mod;
      }
    }
  }
  printf("%d\n", f[n + 1]);
  return 0;
}
