#include <bits/stdc++.h>
using namespace std;
const int mx = 1000005;
const long long mod = 1000000007;
long long M[mx];
map<pair<long long, long long>, long long> mp;
long long p[mx];
long long bigMod(long long p, long long q) {
  if (!q) return 1;
  if (q == 1) return p;
  if (q & 1) {
    return (p * bigMod(p, q - 1)) % mod;
  } else {
    long long ans = bigMod(p, q / 2) % mod;
    return (ans * ans) % mod;
  }
}
long long inv(long long n) { return bigMod(n, mod - 2) % mod; }
long long ncr(long long p, long long q) {
  return ((M[p] % mod) * inv((M[q] * M[p - q]) % mod)) % mod;
}
int main() {
  M[0] = M[1] = 1;
  for (int i = 2; i < mx; ++i) {
    M[i] = i * M[i - 1];
    M[i] %= mod;
  }
  long long h, w, n;
  cin >> h >> w >> n;
  vector<pair<long long, long long> > v;
  for (int i = 0; i < n; ++i) {
    int x, y;
    cin >> x >> y;
    v.push_back({x - 1, y - 1});
  }
  v.push_back({h - 1, w - 1});
  sort(v.begin(), v.end());
  for (int i = 0; i < n + 1; ++i) {
    p[i] = ncr(v[i].first + v[i].second, v[i].first) % mod;
    for (int j = 0; j < i; ++j) {
      if (v[i].second >= v[j].second) {
        p[i] -= (p[j] * ncr(v[i].first + v[i].second - v[j].first - v[j].second,
                            v[i].first - v[j].first)) %
                mod;
        p[i] += mod;
        p[i] %= mod;
      }
    }
  }
  cout << p[n] << endl;
}
