#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long MAXN = 4e5 + 10;
const pair<long long, long long> start = {1, 1};
long long factorial[MAXN];
void fillFactorial() {
  long long i;
  factorial[0] = 1;
  for (i = 1; i < MAXN; i++) {
    factorial[i] = (factorial[i - 1] * i) % MOD;
  }
}
long long binpow(long long a, long long b, long long m) {
  a %= m;
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = res * a % m;
    a = a * a % m;
    b >>= 1;
  }
  return res;
}
long long inverse(long long x) { return binpow(x, MOD - 2, MOD); }
long long combination(long long n, long long k) {
  if (n == 0) return 1;
  return (factorial[n] * inverse(factorial[k]) % MOD) % MOD *
         inverse(factorial[n - k]) % MOD;
}
long long numWays(pair<long long, long long> a, pair<long long, long long> b) {
  if (a.first > b.first || a.second > b.second) return 0;
  long long X = b.first - a.first;
  long long Y = b.second - a.second;
  return combination(X + Y, X);
}
inline void dec(long long &x, long long y) {
  y %= MOD;
  x %= MOD;
  x = (x - y + MOD) % MOD;
}
int32_t main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long i, j;
  fillFactorial();
  long long h, w, n;
  cin >> h >> w >> n;
  set<pair<long long, long long> > temp;
  for (i = 0; i < n; i++) {
    long long r, c;
    cin >> r >> c;
    temp.insert({r, c});
  }
  temp.insert({h, w});
  vector<pair<long long, long long> > obstacles;
  for (auto i : temp) obstacles.push_back(i);
  n = obstacles.size();
  long long dp[n];
  for (i = 0; i < n; i++) {
    dp[i] = numWays(start, obstacles[i]);
    for (j = 0; j < i; j++) {
      dec(dp[i], dp[j] * numWays(obstacles[j], obstacles[i]));
    }
  }
  cout << dp[n - 1] << "\n";
  return 0;
}
