#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1024000000,1024000000")
using namespace std;
int h, w, n, fac[200005], rev[200005], dp[2005];
pair<int, int> a[2005];
int fpow(int x, int y) {
  if (y == 1) return x;
  int t = fpow(x, y >> 1);
  t = 1ll * t * t % 1000000007;
  if (y & 1) t = 1ll * t * x % 1000000007;
  return t;
}
int C(int x, int y) {
  return 1ll * (1ll * fac[x] * rev[y]) % 1000000007 * rev[x - y] % 1000000007;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> h >> w >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i].first >> a[i].second;
  }
  sort(a, a + n);
  a[n] = make_pair(h, w);
  fac[0] = 1;
  rev[0] = 1;
  for (int i = 1; i <= 200000; i++) {
    fac[i] = 1ll * fac[i - 1] * i % 1000000007;
    rev[i] = fpow(fac[i], 1000000007 - 2);
  }
  for (int i = 0; i <= n; i++) {
    dp[i] = C(a[i].first + a[i].second - 2, a[i].first - 1);
    for (int j = 0; j < i; j++) {
      if (a[j].first <= a[i].first && a[j].second <= a[i].second) {
        dp[i] = (dp[i] + 1000000007 -
                 1ll * dp[j] *
                     C(a[i].first - a[j].first + a[i].second - a[j].second,
                       a[i].first - a[j].first) %
                     1000000007) %
                1000000007;
      }
    }
  }
  cout << dp[n] << endl;
  return 0;
}
