#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 2000;
const int MOD = 1000000000 + 7;
int h, w, n;
int fac[200000 + 10], inv[200000 + 10];
pair<int, int> data[MAX_N + 10];
int f[MAX_N + 10];
int fastPow(int b, int p) {
  int ans = 1;
  while (p) {
    if (p & 1) ans = (int)((long long)ans * b % MOD);
    p >>= 1;
    b = (int)((long long)b * b % MOD);
  }
  return ans;
}
int main() {
  scanf("%d%d%d", &h, &w, &n);
  fac[0] = 1;
  inv[0] = 1;
  for (int i = 1; i <= 200000; i++) {
    fac[i] = (int)((long long)fac[i - 1] * i % MOD);
    inv[i] = fastPow(fac[i], MOD - 2);
  }
  for (int i = 1; i <= n; i++) scanf("%d%d", &data[i].first, &data[i].second);
  data[++n] = make_pair(h, w);
  sort(data + 1, data + n + 1);
  for (int i = 1; i <= n; i++) {
    f[i] = (int)((long long)fac[data[i].first - 1 + data[i].second - 1] *
                 inv[data[i].first - 1] % MOD * inv[data[i].second - 1] % MOD);
    for (int j = 1; j < i; j++)
      if (data[j].first <= data[i].first && data[j].second <= data[i].second) {
        f[i] -= (int)((long long)fac[data[i].first - data[j].first +
                                     data[i].second - data[j].second] *
                      inv[data[i].first - data[j].first] % MOD *
                      inv[data[i].second - data[j].second] % MOD * f[j] % MOD);
        if (f[i] < 0) f[i] += MOD;
      }
  }
  printf("%d\n", f[n]);
  return 0;
}
