#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
pair<long long, long long> poi[2010];
long long h, w, n, inv[200010], fac[200010], finv[200010], f[2010];
void init() {
  inv[1] = fac[0] = fac[1] = finv[0] = finv[1] = 1;
  for (int i = 2; i <= h + w; i++) {
    inv[i] = (mod - mod / i) * inv[mod % i] % mod;
    fac[i] = fac[i - 1] * i % mod;
    finv[i] = finv[i - 1] * inv[i] % mod;
  }
}
long long C(long long first, long long second) {
  return fac[first] * finv[second] % mod * finv[first - second] % mod;
}
int main() {
  scanf("%lld%lld%lld", &h, &w, &n);
  init();
  for (int i = 1; i <= n; i++) scanf("%lld%lld", &poi[i].first, &poi[i].second);
  sort(poi + 1, poi + n + 1);
  poi[n + 1].first = h, poi[n + 1].second = w;
  f[0] = 1;
  for (int i = 1; i <= n + 1; i++) {
    f[i] = C(poi[i].first + poi[i].second - 2, poi[i].first - 1);
    long long tmp = 0;
    for (int j = 1; j < i; j++) {
      if (poi[j].first > poi[i].first || poi[j].second > poi[i].second)
        continue;
      tmp += f[j] *
             C(poi[i].first + poi[i].second - poi[j].first - poi[j].second,
               poi[i].first - poi[j].first) %
             mod;
      tmp %= mod;
    }
    f[i] = (f[i] - tmp + mod) % mod;
  }
  cout << f[n + 1] << endl;
  return 0;
}
