#include <bits/stdc++.h>
using namespace std;
int64_t fact[200002] = {1}, inv[200002] = {1};
int64_t dp[2002];
pair<int64_t, int64_t> in[2002];
int64_t powmo(int64_t a, int64_t b, int64_t n) {
  int64_t r = 1;
  for (; b; b >>= 1) {
    if (b & 1) r = r * a % n;
    a = a * a % n;
  }
  return r;
}
void build() {
  for (int64_t i = 1; i < 200002; i++)
    fact[i] = fact[i - 1] * i % 1000000007ll,
    inv[i] = powmo(fact[i], 1000000007ll - 2, 1000000007ll);
}
int64_t C(int64_t n, int64_t m) {
  return fact[n] * inv[m] % 1000000007ll * inv[n - m] % 1000000007ll;
}
int main() {
  build();
  {
    cin.tie(0);
    ios_base::sync_with_stdio(false);
  };
  int64_t h, w, n;
  cin >> h >> w >> n;
  for (int i = 0; i < n; i++) cin >> in[i].first >> in[i].second;
  in[n] = {h, w};
  sort(in, in + n);
  for (int i = 0; i <= n; i++) {
    dp[i] = C(in[i].first + in[i].second - 2, in[i].first - 1);
    for (int j = i - 1; j >= 0; j--)
      if (in[i].second >= in[j].second) {
        dp[i] = (dp[i] -
                 dp[j] *
                     C(in[i].first + in[i].second - in[j].first - in[j].second,
                       in[i].first - in[j].first) %
                     1000000007ll +
                 1000000007ll) %
                1000000007ll;
      }
  }
  cout << dp[n];
  return 0;
}
