#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200005;
const int mod = 1e9 + 7;
int n, m, q, fac[MAXN], inv[MAXN];
void pre(int N) {
  inv[0] = inv[1] = fac[0] = fac[1] = 1;
  for (int i = 2; i <= N; ++i)
    inv[i] = 1ll * (mod - mod / i) * inv[mod % i] % mod,
    fac[i] = 1ll * fac[i - 1] * i % mod;
  for (int i = 2; i <= N; ++i) inv[i] = 1ll * inv[i - 1] * inv[i] % mod;
}
inline int C(int n, int m) {
  return n < m ? 0 : 1ll * fac[n] * inv[m] % mod * inv[n - m] % mod;
}
struct node {
  int x, y;
  node() {}
  node(int x, int y) : x(x), y(y) {}
  inline bool operator<(const node &o) const {
    return x == o.x ? y < o.y : x < o.x;
  }
  inline bool operator==(const node &o) const { return x == o.x && y == o.y; }
  inline friend int calc(node A, node B) {
    return C(B.x - A.x + B.y - A.y, B.x - A.x);
  }
} p[2005];
int f[2005];
int main() {
  scanf("%d%d%d", &n, &m, &q);
  pre(n + m);
  for (int i = 1; i <= q; ++i) scanf("%d%d", &p[i].x, &p[i].y);
  ++q, p[q].x = n, p[q].y = m;
  sort(p + 1, p + q + 1);
  q = unique(p + 1, p + q + 1) - p - 1;
  node S = node(1, 1);
  for (int i = 1; i <= q; ++i) {
    f[i] = calc(S, p[i]);
    for (int j = 1; j < i; ++j)
      if (p[i].x >= p[j].x && p[i].y >= p[j].y)
        f[i] = (f[i] - 1ll * f[j] * calc(p[j], p[i]) % mod) % mod;
  }
  printf("%d\n", (f[q] + mod) % mod);
}
