#include <bits/stdc++.h>
using namespace std;
int h, w, n;
const int maxn = 2e3 + 5;
const int N = 2e5 + 5;
const int P = 1e9 + 7;
struct point {
  int x, y;
  bool operator<(const point &h) const { return x == h.x ? y < h.y : x < h.x; }
} p[maxn];
int fac[N], inv[N];
int f[maxn];
int ksm(int a, int b, int p) {
  int ans = 1;
  while (b) {
    if (b & 1) ans = 1ll * ans * a % P;
    b >>= 1, a = 1ll * a * a % P;
  }
  return ans;
}
int C(int n, int m) {
  if (n < m) return 0;
  return 1ll * fac[n] * inv[m] % P * inv[n - m] % P;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  cin >> h >> w >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> p[i].x >> p[i].y;
  }
  p[++n].x = h, p[n].y = w;
  sort(p + 1, p + n + 1);
  fac[0] = inv[0] = 1;
  int NN = h + w;
  for (int i = 1; i <= NN; ++i) {
    fac[i] = 1ll * fac[i - 1] * i % P;
  }
  inv[NN] = ksm(fac[NN], P - 2, P);
  for (int i = NN - 1; i >= 1; --i) {
    inv[i] = 1ll * inv[i + 1] * (i + 1) % P;
  }
  for (int i = 1; i <= n; ++i) f[i] = C(p[i].x + p[i].y - 2, p[i].x - 1);
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j < i; ++j) {
      if (p[i].x < p[j].x || p[i].y < p[j].y) continue;
      f[i] -= 1ll * f[j] *
              C(p[i].x + p[i].y - p[j].x - p[j].y, p[i].x - p[j].x) % P;
      if (f[i] < 0) f[i] += P;
    }
  }
  cout << f[n] << '\n';
  return 0;
}
