#include <bits/stdc++.h>
using namespace std;
const int MAX = 3000;
const int MOD = 1e9 + 7;
long long dp[MAX][2];
long long fac[MAX * MAX];
long long pow_mod(long long a, long long k) {
  long long rst = 1;
  while (k) {
    if (k & 1) rst = rst * a % MOD;
    a = a * a % MOD;
    k >>= 1;
  }
  return rst;
}
long long inv(long long x) { return pow_mod(x, MOD - 2); }
long long ok_inv[(int)2e5 + 200];
long long C(long long m, long long n) {
  return fac[m] * ok_inv[m - n] % MOD * ok_inv[n] % MOD;
}
int main() {
  fac[0] = 1;
  ok_inv[0] = 1;
  for (int i = 1; i < 2e5 + 100; i++) fac[i] = fac[i - 1] * i % MOD;
  for (int i = 1; i < 2e5 + 100; i++) ok_inv[i] = inv(fac[i]);
  int h, w, n;
  scanf("%d %d %d", &h, &w, &n);
  dp[0][1] = 1;
  vector<pair<int, pair<int, int> > > data;
  data.push_back(make_pair(2, make_pair(1, 1)));
  for (int i = 1; i <= n; i++) {
    int x, y;
    scanf("%d %d", &x, &y);
    data.push_back(make_pair(x + y, make_pair(x, y)));
  }
  data.push_back(make_pair(h + w, make_pair(h, w)));
  sort(data.begin(), data.end());
  for (int i = 0; i < n + 1; i++) {
    for (int j = i + 1; j < n + 2; j++) {
      int dx = data[j].second.first - data[i].second.first;
      int dy = data[j].second.second - data[i].second.second;
      if (dx >= 0 && dy >= 0) {
        dp[j][1] = (dp[j][1] + dp[i][0] * C(dx + dy, dx) % MOD) % MOD;
        dp[j][0] = (dp[j][0] + dp[i][1] * C(dx + dy, dx) % MOD) % MOD;
      }
    }
  }
  printf("%lld\n", (dp[n + 1][0] - dp[n + 1][1] + MOD) % MOD);
}
