#include <bits/stdc++.h>
using namespace std;
const int md = 1e9 + 7, M = 2e5 + 5, N = 2e3 + 4;
long long fact[M], rfact[M], i, h, w, n, ans[N], j, x, y;
pair<long long, long long> p[N];
long long pw(long long a, long long b) {
  if (b == 0) return 1LL;
  if (b & 1) return (a * pw(a, b - 1)) % md;
  long long x = pw(a, b / 2);
  return (x * x) % md;
}
long long C(long long a, long long b) {
  return (((fact[a] * rfact[b]) % md) * rfact[a - b]) % md;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  for (i = 1, fact[0] = 1, rfact[0] = 1; i < M; i++) {
    fact[i] = (fact[i - 1] * i) % md;
    rfact[i] = pw(fact[i], md - 2);
  }
  cin >> h >> w >> n;
  for (i = 0; i < n; i++) cin >> p[i].first >> p[i].second;
  p[n].first = h;
  p[n].second = w;
  sort(p, p + n + 1);
  for (i = 0; i <= n; i++) {
    x = p[i].first, y = p[i].second;
    ans[i] = C(x + y - 2, x - 1);
    for (j = 0; j < i; j++)
      if (p[j].first <= x && p[j].second <= y)
        ans[i] =
            (ans[i] + md -
             (ans[j] * C(x - p[j].first + y - p[j].second, x - p[j].first)) %
                 md) %
            md;
  }
  cout << ans[n] % md;
  return 0;
}
