#include <bits/stdc++.h>
using namespace std;
const int N = 2e3 + 5;
const int M = 2e5 + 5;
const int mod = 1e9 + 7;
int fac[M], inv[M], n, m, cnt, in[N];
long long f[N];
vector<int> G[N], o;
struct Point {
  int x, y;
} P[N];
void init() {
  fac[0] = 1;
  for (int i = 1; i < M; i++) fac[i] = (long long)fac[i - 1] * i % mod;
  inv[1] = 1;
  for (int i = 2; i < M; i++)
    inv[i] = (long long)(mod - mod / i) * inv[mod % i] % mod;
  inv[0] = 1;
  for (int i = 1; i < M; i++) inv[i] = (long long)inv[i] * inv[i - 1] % mod;
}
int C(int x, int y) {
  if (x < y || y < 0) return 0;
  return (long long)fac[x] * inv[y] % mod * inv[x - y] % mod;
}
int calc(Point A, Point B) {
  int x = B.x - A.x, y = B.y - A.y;
  return C(x + y, x);
}
void pre() {
  scanf("%d%d%d", &n, &m, &cnt);
  memset(in, 0, sizeof in);
  for (int i = 1; i <= cnt; i++) {
    scanf("%d%d", &P[i].x, &P[i].y);
    for (int j = 1; j < i; j++) {
      if (P[i].x <= P[j].x && P[i].y <= P[j].y) {
        G[i].push_back(j);
        in[j]++;
      } else if (P[i].x >= P[j].x && P[i].y >= P[j].y) {
        G[j].push_back(i);
        in[i]++;
      }
    }
  }
  P[0] = (Point){1, 1};
  P[cnt + 1] = (Point){n, m};
}
void topo() {
  queue<int> q;
  for (int i = 1; i <= cnt; i++)
    if (!in[i]) q.push(i);
  o.push_back(0);
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    o.push_back(u);
    for (int i = 0; i < G[u].size(); i++) {
      int v = G[u][i];
      in[v]--;
      if (!in[v]) q.push(v);
    }
  }
  o.push_back(++cnt);
}
void solve() {
  f[0] = 1;
  for (int i = 1; i <= cnt; i++) {
    f[o[i]] = calc(P[0], P[o[i]]);
    for (int j = 1; j < i; j++)
      f[o[i]] = (f[o[i]] - f[o[j]] * calc(P[o[j]], P[o[i]]) % mod + mod) % mod;
  }
  printf("%lld\n", f[cnt]);
}
int main() {
  init();
  pre();
  topo();
  solve();
  return 0;
}
