#include <bits/stdc++.h>
using namespace std;
const long long M = 1e9 + 7;
int read() {
  int x = 0, f = 1;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') f = -1;
  for (; isdigit(ch); ch = getchar()) x = (x << 3) + (x << 1) + ch - 48;
  return x * f;
}
bool cmp(pair<int, int> a, pair<int, int> b) {
  return a.first < b.first || (a.first == b.first && a.second < b.second);
}
pair<int, int> a[2010];
int h, w, n;
long long sum[2010], inv[200010], fac[200010];
long long quickpow(long long x, int n) {
  long long y = 1;
  for (; n; x = x * x % M, n >>= 1)
    if (n & 1) y = y * x % M;
  return y;
}
void init(int n) {
  fac[0] = 1;
  for (int i = 1; i <= n; i++)
    fac[i] = fac[i - 1] * 1ll * i % M, inv[i] = quickpow(fac[i], M - 2);
  inv[0] = inv[1];
}
long long cal(int x, int y) { return fac[x + y] * inv[x] % M * inv[y] % M; }
int main() {
  h = read(), w = read(), n = read();
  for (int i = 1; i <= n; i++) {
    int x = read() - 1, y = read() - 1;
    a[i] = pair<int, int>(x, y);
  }
  sort(a + 1, a + n + 1, cmp);
  a[++n] = pair<int, int>(h - 1, w - 1);
  init(h + w);
  for (int i = 1; i <= n; i++) {
    sum[i] = cal(a[i].first, a[i].second);
    for (int j = 0; j < i; j++)
      if (a[j].first <= a[i].first && a[j].second <= a[i].second)
        sum[i] =
            (sum[i] -
             sum[j] * cal(a[i].first - a[j].first, a[i].second - a[j].second) %
                 M) %
            M;
  }
  printf("%d\n", (sum[n] + M) % M);
  return 0;
}
