#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
long long dp[2005];
long long fact[200005], ifact[200005];
vector<pair<int, int> > v;
long long bigmod(long long n, long long p) {
  if (p == 0)
    return 1;
  else if (p & 1)
    return (n * bigmod(n, p - 1)) % mod;
  else {
    long long x = bigmod(n, p / 2);
    return (x * x) % mod;
  }
}
void precalc() {
  fact[0] = fact[1] = 1;
  for (int i = 2; i <= 200001; i++) fact[i] = (fact[i - 1] * i) % mod;
  ifact[0] = 1;
  for (int i = 1; i <= 200001; i++) ifact[i] = bigmod(fact[i], mod - 2);
}
long long solve(int a, int b, int c, int d) {
  int x = c - a;
  int y = d - b;
  return (((fact[x + y] * ifact[x]) % mod) * ifact[y]) % mod;
}
int t, n, m, k, u, z, a, b, c, d, sz;
int main() {
  precalc();
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 0; i < k; i++) {
    scanf("%d%d", &u, &z);
    v.push_back({u, z});
  }
  v.push_back(make_pair(n, m));
  sort(v.begin(), v.end());
  for (int i = 0; i < v.size(); i++)
    dp[i] = solve(1, 1, v[i].first, v[i].second);
  sz = v.size();
  for (int i = 0; i < sz; i++)
    for (int j = i + 1; j < sz; j++) {
      a = v[i].first, b = v[i].second, c = v[j].first, d = v[j].second;
      if (c < a || d < b) continue;
      dp[j] = (dp[j] - ((dp[i] * solve(a, b, c, d)) % mod) + mod) % mod;
    }
  cout << dp[sz - 1] << endl;
  return 0;
}
