#include <bits/stdc++.h>
using namespace std;
struct Point {
  int x, y;
} a[2000 + 5];
int h, w, n, ans, dp[2000 + 5], f[200000 + 5], inv[200000 + 5];
int read() {
  char c;
  int x = 0, f = 1;
  c = getchar();
  while (c > '9' || c < '0') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
  return x * f;
}
bool cmp(Point a, Point b) { return a.x == b.x ? a.y < b.y : a.x < b.x; }
int Dec(int a, int b) { return (a -= b) < 0 ? a + 1000000007 : a; }
int Mul(int a, int b) { return 1ll * a * b % 1000000007; }
int Qpow(int a, int b) {
  int ans = 1;
  while (b) {
    if (b & 1) ans = Mul(ans, a);
    a = Mul(a, a), b >>= 1;
  }
  return ans;
}
int C(int n, int m) {
  if (m > n) return 0;
  return Mul(Mul(f[n], inv[m]), inv[n - m]);
}
int main() {
  h = read(), w = read(), n = read();
  f[0] = 1, inv[0] = 1;
  for (int i = 1; i <= h + w; ++i)
    f[i] = Mul(f[i - 1], i), inv[i] = Qpow(f[i], 1000000007 - 2);
  for (int i = 1; i <= n; ++i) a[i].x = read(), a[i].y = read();
  sort(a + 1, a + n + 1, cmp);
  for (int i = 1; i <= n; ++i) {
    dp[i] = C(a[i].x + a[i].y - 2, a[i].x - 1);
    for (int j = 1; j <= i - 1; ++j)
      dp[i] = Dec(dp[i], Mul(dp[j], C(a[i].x - a[j].x + a[i].y - a[j].y,
                                      a[i].x - a[j].x)));
  }
  ans = C(h + w - 2, h - 1);
  for (int i = 1; i <= n; ++i)
    ans = Dec(ans, Mul(dp[i], C(h - a[i].x + w - a[i].y, h - a[i].x)));
  printf("%d", ans);
  return 0;
}
