#include <bits/stdc++.h>
using namespace std;
long long h, w, n, dp[2000 + 10], fac[200000 + 100], caf[200000 + 100];
pair<int, int> pi[2000 + 10];
long long deg(long long x, long long d) {
  d %= 1000000007 - 1;
  if (d < 0) d += 1000000007 - 1;
  long long y = 1;
  while (d) {
    if (d & 1) y *= x, y %= 1000000007;
    x *= x, x %= 1000000007;
    d /= 2;
  }
  return y;
}
long long coef(int n, int k) {
  return fac[n] * caf[k] % 1000000007 * caf[n - k] % 1000000007;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  fac[0] = caf[0] = 1;
  for (int i = 1; i < 200000 + 100; i++)
    fac[i] = i * fac[i - 1] % 1000000007, caf[i] = deg(fac[i], -1);
  cin >> h >> w >> n;
  for (int i = 0; i < n; i++) cin >> pi[i].first >> pi[i].second;
  pi[n].first = h;
  pi[n].second = w;
  n++;
  sort(pi, pi + n);
  for (int i = 0; i < n; i++) {
    dp[i] = coef(pi[i].first + pi[i].second - 2, pi[i].second - 1) % 1000000007;
    long long tmp1 = 0;
    for (int j = 0; j < i; j++) {
      if (pi[j].first <= pi[i].first && pi[j].second <= pi[i].second) {
        long long a =
            ((dp[j] % 1000000007) *
             (coef(pi[i].first - pi[j].first + pi[i].second - pi[j].second,
                   pi[i].second - pi[j].second) %
              1000000007)) %
            1000000007;
        tmp1 = ((tmp1 % 1000000007) + (a % 1000000007)) % 1000000007;
      }
    }
    dp[i] = ((dp[i] % 1000000007) - (tmp1 % 1000000007)) % 1000000007;
  }
  if (dp[n - 1] < 0) dp[n - 1] += 1000000007;
  cout << dp[n - 1] << "\n";
}
