#include <bits/stdc++.h>
using namespace std;
long long int powm(long long int a, int b, int n) {
  long long int rm = 1;
  while (b) {
    if (b % 2) {
      rm = (rm * a) % n;
    }
    a = (a * a) % n;
    b /= 2;
  }
  return rm;
}
long long int dp[2010] = {0};
long long int fac[int(2e5 + 1000)], ifac[int(2e5 + 1000)];
long long int f(int r, int c) {
  return ((fac[r + c - 2] * ifac[r - 1]) % int(1e9 + 7) * ifac[c - 1]) %
         int(1e9 + 7);
}
vector<pair<int, int> > v;
int main() {
  int n, h, w, r, c;
  cin >> h >> w >> n;
  v.push_back(make_pair(0, 0));
  for (int i = int(1); i <= (int)n; i++) {
    scanf("%d", &r);
    ;
    scanf("%d", &c);
    ;
    v.push_back(make_pair(c, r));
  }
  sort(v.begin() + 1, v.end());
  fac[0] = 1;
  ifac[0] = 1;
  for (int i = 1; i <= 2e5; ++i) {
    fac[i] = (fac[i - 1] * i) % int(1e9 + 7);
    ifac[i] = powm(fac[i], int(1e9 + 7) - 2, int(1e9 + 7));
  }
  long long int ways, ans;
  ans = f(h, w);
  for (int i = 1; i <= n; ++i) {
    ways = f(v[i].second, v[i].first);
    for (int j = 1; j < i; ++j) {
      if (v[j].first <= v[i].first && v[j].second <= v[i].second) {
        ways = ways - (dp[j] * f(v[i].second - v[j].second + 1,
                                 v[i].first - v[j].first + 1)) %
                          int(1e9 + 7);
        ways = (ways % int(1e9 + 7) + int(1e9 + 7)) % int(1e9 + 7);
      }
    }
    dp[i] = ways;
    ans -= (ways * f(h - v[i].second + 1, w - v[i].first + 1)) % int(1e9 + 7);
    ans = (ans % int(1e9 + 7) + int(1e9 + 7)) % int(1e9 + 7);
  }
  cout << ans << endl;
  return 0;
}
