#include <bits/stdc++.h>
using namespace std;
const int N = 2005;
const int mod = 1000000007;
long long qmod(long long a, long long b, long long p) {
  long long res = 1;
  while (b != 0) {
    if (b & 1) res = (res * a) % p;
    a = (a * a) % p;
    b >>= 1;
  }
  return res;
}
long long dp[N], fac[200005], inv[200005];
struct node {
  int x, y;
} a[N];
int C(long long n, long long m) {
  return (fac[n] * inv[n - m] % mod) * inv[m] % mod;
}
bool cmp(node a, node b) { return a.x < b.x || (a.x == b.x && a.y < b.y); }
int main() {
  memset(dp, 0, sizeof(dp));
  fac[0] = inv[0] = 1;
  for (int i = 1; i <= 200000; i++) {
    fac[i] = fac[i - 1] * i % mod;
    inv[i] = inv[i - 1] * qmod(i, mod - 2, mod) % mod;
  }
  int h, w, n;
  cin >> h >> w >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i].x >> a[i].y;
    a[i].x--, a[i].y--;
  }
  a[n].x = h - 1, a[n].y = w - 1;
  sort(a, a + n, cmp);
  dp[0] = 1;
  for (int i = 0; i <= n; i++) {
    dp[i] = C(a[i].x + a[i].y, a[i].x) % mod;
    for (int j = 0; j < i; j++) {
      if (a[j].x <= a[i].x && a[j].y <= a[i].y) {
        dp[i] = (dp[i] -
                 dp[j] * C(a[i].x - a[j].x + a[i].y - a[j].y, a[i].x - a[j].x) +
                 mod) %
                mod;
        dp[i] = (dp[i] + mod) % mod;
      }
    }
  }
  cout << dp[n] % mod << endl;
  return 0;
}
