#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 5;
const long long MOD = 1e9 + 7;
const int INF = 1e9;
long long f[2 * MAXN], fr[2 * MAXN];
set<pair<int, int> > bad;
long long dp[MAXN];
pair<int, int> p[MAXN];
long long add(long long a, long long b) { return (a + b + MOD) % MOD; }
long long mul(long long a, long long b) { return (a * b + MOD) % MOD; }
long long binpow(long long a, long long st) {
  long long ans = 1;
  for (; st; st >>= 1) {
    if (st & 1) ans = mul(ans, a);
    a = mul(a, a);
  }
  return ans;
}
long long c(int n, int m) {
  if (n < m) return 0;
  return mul(f[n], mul(fr[m], fr[n - m]));
}
void solve() {
  int h, w, n;
  scanf("%d%d%d", &h, &w, &n);
  f[0] = fr[0] = 1;
  for (int i = 1; i < 2 * MAXN; i++) {
    f[i] = mul(f[i - 1], i);
    fr[i] = binpow(f[i], MOD - 2);
  }
  int x, y;
  int top;
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &x, &y);
    p[i] = make_pair(x, y);
  }
  p[n++] = make_pair(1, 1);
  dp[0] = 0;
  p[n++] = make_pair(h, w);
  sort(p, p + n);
  for (int i = 1; i < n; i++) {
    x = p[i].first;
    y = p[i].second;
    long long cur = c(x + y - 2, x - 1);
    for (int j = 0; j < i; j++) {
      if (p[j].first <= x && p[j].second <= y) {
        long long cur2 =
            mul(c(x - p[j].first + y - p[j].second, x - p[j].first), dp[j]);
        cur = add(cur, -cur2);
      }
    }
    dp[i] = cur;
  }
  cout << dp[n - 1];
}
int main() {
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
