#include <bits/stdc++.h>
#pragma GCC optimize(3)
using namespace std;
int h, w, n;
pair<int, int> a[2005];
int dp[2005];
int fact[200005], invf[200005];
int pow_mod(int a, int i) {
  int s = 1;
  while (i) {
    if (i & 1) s = 1LL * s * a % 1000000007;
    a = 1LL * a * a % 1000000007;
    i >>= 1;
  }
  return s;
}
int comb(int n, int k) {
  if (n < k) return 0;
  return 1LL * fact[n] * invf[k] % 1000000007 * invf[n - k] % 1000000007;
}
int main() {
  scanf("%d%d%d", &h, &w, &n);
  for (int i = 0; i < n; i++) scanf("%d%d", &a[i].first, &a[i].second);
  a[n].first = h;
  a[n].second = w;
  sort(a, a + n + 1);
  fact[0] = invf[0] = 1;
  for (int i = 1; i <= 200000; i++)
    fact[i] = 1LL * fact[i - 1] * i % 1000000007;
  invf[200000] = pow_mod(fact[200000], 1000000007 - 2);
  for (int i = 199999; i >= 1; i--)
    invf[i] = 1LL * invf[i + 1] * (i + 1) % 1000000007;
  for (int i = 0; i <= n; i++)
    dp[i] = comb(a[i].first + a[i].second - 2, a[i].first - 1);
  for (int i = 1; i <= n; i++)
    for (int j = 0; j < i; j++)
      dp[i] = ((dp[i] -
                1LL * dp[j] *
                    comb(a[i].first + a[i].second - a[j].first - a[j].second,
                         a[i].first - a[j].first)) %
                   1000000007 +
               1000000007) %
              1000000007;
  printf("%d\n", dp[n]);
  return 0;
}
