#include <bits/stdc++.h>
using namespace std;
const int N = 200 * 1000 + 10;
const int mod = 1000 * 1000 * 1000 + 7;
pair<int, int> x[N];
long long f[N], e[N], dp[N];
long long pw(long long p, long long r) {
  if (r == 0) return 1;
  return pw((p * p) % mod, r / 2) * ((r % 2) ? p : 1) % mod;
}
void pre() {
  f[0] = 1;
  e[0] = 1;
  for (int i = 1; i < N; i++) {
    f[i] = (f[i - 1] * i) % mod;
    e[i] = pw(f[i], mod - 2) % mod;
  }
}
long long C(long long n, long long k) {
  long long a = (((f[n] * e[k]) % mod) * e[n - k]) % mod;
  return a;
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  ;
  pre();
  int h, w, n;
  scanf("%d %d %d", &h, &w, &n);
  for (int i = 0; i < n; i++) {
    scanf("%d %d", &x[i].first, &x[i].second);
  }
  x[n].first = h, x[n].second = w;
  n++;
  sort(x, x + n);
  for (int i = 0; i < n; i++) {
    dp[i] = C(x[i].first + x[i].second - 2, x[i].first - 1);
    for (int j = 0; j < i; j++) {
      if (x[i].first < x[j].first || x[i].second < x[j].second) continue;
      dp[i] = (dp[i] + mod -
               ((dp[j] *
                 C(x[i].first - x[j].first + x[i].second - x[j].second,
                   x[i].first - x[j].first) %
                 mod))) %
              mod;
    }
  }
  printf("%lld\n", dp[n - 1]);
  return 0;
}
