#include <bits/stdc++.h>
using namespace std;
const int P = 1000000007;
const int INF = 0x3f3f3f3f;
inline int mul(const int& a, const int& b) { return 1ll * a * b % P; }
inline int add(const int& a, const int& b) {
  return (a + b >= P) ? a + b - P : a + b;
}
inline int sub(const int& a, const int& b) {
  return (a - b < 0) ? a - b + P : a - b;
}
inline int read() {
  int x(0), w(1);
  char c = getchar();
  while (c ^ '-' && (c < '0' || c > '9')) c = getchar();
  if (c == '-') w = -1, c = getchar();
  while (c >= '0' && c <= '9') x = (x << 3) + (x << 1) + c - '0', c = getchar();
  return x * w;
}
struct Coor {
  int x, y;
} a[2010];
int n, h, w, f[2010], fac[200010];
inline bool cmp(const Coor& A, const Coor& B) {
  if (A.x != B.x) return A.x < B.x;
  return A.y < B.y;
}
inline int inv(int x) {
  int res = 1, y = P - 2;
  while (y > 0) {
    if (y & 1) res = mul(res, x);
    y >>= 1, x = mul(x, x);
  }
  return res;
}
int C(int n, int m) { return mul(fac[n], mul(inv(fac[m]), inv(fac[n - m]))); }
int main() {
  h = read(), w = read(), n = read();
  for (int i = 1; i <= n; ++i) {
    a[i].x = read(), a[i].y = read();
  }
  fac[0] = 1;
  fac[1] = 1;
  for (int i = 2; i <= h + w; ++i) {
    fac[i] = mul(fac[i - 1], i);
  }
  sort(a + 1, a + n + 1, cmp);
  a[n + 1].x = h, a[n + 1].y = w;
  for (int i = 1; i <= n + 1; ++i) {
    f[i] = C(a[i].x + a[i].y - 2, a[i].x - 1);
    for (int j = 1; j < i; ++j) {
      if (a[j].x <= a[i].x && a[j].y <= a[i].y) {
        f[i] = sub(f[i], mul(f[j], C(a[i].x - a[j].x + a[i].y - a[j].y,
                                     a[i].x - a[j].x)));
      }
    }
  }
  printf("%d\n", f[n + 1]);
  return 0;
}
