#include <bits/stdc++.h>
using namespace std;
const int inf = 0x7f7f7f7f;
const int maxn = 200000;
const long long p = 1e9 + 7;
long long fac[maxn + 10];
void get_fac() {
  fac[0] = 1;
  for (int i = 1; i <= maxn; ++i) {
    fac[i] = fac[i - 1] * i % p;
  }
}
long long mpow(long long a, long long b) {
  long long c = 1;
  while (b) {
    if (b & 1) c = c * a % p;
    a = a * a % p;
    b >>= 1;
  }
  return c;
}
long long C(int n, int m) {
  if (m > n) return 0;
  return fac[n] * mpow(fac[n - m] * fac[m] % p, p - 2) % p;
}
int main() {
  get_fac();
  int r, c, n;
  pair<int, int> a[2222];
  long long dp[2222];
  memset(dp, 0, sizeof dp);
  cin >> r >> c >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i].first >> a[i].second;
  }
  a[n].first = r, a[n].second = c;
  sort(a, a + n + 1);
  for (int i = 0; i < n; ++i) {
    int x1 = a[i].first, y1 = a[i].second;
    long long d1 = C(x1 + y1 - 2, y1 - 1) - dp[i];
    for (int j = i + 1; j < n + 1; ++j) {
      int x2 = a[j].first, y2 = a[j].second;
      if (x2 >= x1 && y2 >= y1) {
        long long d2 = C(x2 - x1 + y2 - y1, y2 - y1);
        dp[j] = (dp[j] + d1 * d2) % p;
      }
    }
  }
  cout << ((C(r + c - 2, c - 1) - dp[n]) % p + p) % p << endl;
  return 0;
}
