#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 333;
const long long linf = 1e18 + 333;
const int N = 2000 + 5;
const int M = 2e5 + 5;
const int mod = 1e9 + 7;
int h, w, n, fact[M], ifact[M], dp[N];
pair<int, int> a[N];
int get(int x, int y) {
  return (long long)fact[x + y] * ifact[x] % mod * ifact[y] % mod;
}
int main() {
  fact[0] = ifact[0] = fact[1] = ifact[1] = 1;
  for (int i = 2; i < M; i++) {
    fact[i] = (long long)fact[i - 1] * i % mod;
    int res = 1, x = i, k = mod - 2;
    while (k) {
      if (k & 1) res = (long long)res * x % mod;
      x = (long long)x * x % mod;
      k >>= 1;
    }
    ifact[i] = (long long)ifact[i - 1] * res % mod;
  }
  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++] = pair<int, int>(h, w);
  sort(a, a + n);
  for (int i = 0; i < n; i++) {
    dp[i] = get(a[i].first - 1, a[i].second - 1);
    for (int j = 0; j < i; j++)
      if (a[j].second <= a[i].second)
        dp[i] = (dp[i] + mod -
                 (long long)dp[j] *
                     get(a[i].first - a[j].first, a[i].second - a[j].second) %
                     mod) %
                mod;
  }
  printf("%d\n", dp[n - 1]);
  return 0;
}
