#include <bits/stdc++.h>
using namespace std;
const int md = 1000 * 1000 * 1000 + 7;
const int mxn = 2000 * 100;
int h, w, n;
pair<int, int> a[2005];
int fa[mxn + 5];
int iv[mxn + 5];
int dp[mxn + 5];
inline int fe(int a, int p) {
  int ret = 1;
  while (p) {
    if (p & 1) ret = (1LL * a * ret) % md;
    a = (1LL * a * a) % md;
    p >>= 1;
  }
  return ret;
}
int c(int k, int r) { return (((1LL * fa[k + r] * iv[k]) % md) * iv[r]) % md; }
int main() {
  fa[0] = iv[0] = 1;
  scanf("%d%d%d", &h, &w, &n);
  for (int i = 1; i <= mxn; ++i)
    fa[i] = 1LL * i * fa[i - 1] % md, iv[i] = fe(fa[i], md - 2);
  for (int i = 0; i < n; ++i) {
    scanf("%d%d", &a[i].first, &a[i].second);
  }
  a[n++] = {h, w};
  sort(a, a + n);
  for (int i = 0; i < n; ++i) {
    dp[i] = c(a[i].first - 1, a[i].second - 1);
    for (int j = 0; j < i; ++j)
      if (a[i].first >= a[j].first && a[i].second >= a[j].second) {
        dp[i] = (dp[i] -
                 ((1LL * dp[j] *
                   c(a[i].first - a[j].first, a[i].second - a[j].second)) %
                  md) +
                 md) %
                md;
      }
  }
  cout << dp[n - 1] << endl;
}
