#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const double EPS = 1e-6;
int fact[200005];
int revfact[200005];
int FastPow(int a, int n) {
  int res = 1;
  for (; n > 0; n >>= 1) {
    if (n & 1) res = 1LL * res * a % (int)(1e9 + 7);
    a = 1LL * a * a % (int)(1e9 + 7);
  }
  return res;
}
void Setup() {
  fact[0] = revfact[0] = 1;
  for (int i = 1; i < 200005; i++) {
    fact[i] = 1LL * fact[i - 1] * i % (int)(1e9 + 7);
    revfact[i] = FastPow(fact[i], (int)(1e9 + 7) - 2);
  }
}
int C(int n, int m) {
  if (n < m) return 0;
  return 1LL * fact[n] * revfact[m] % (int)(1e9 + 7) * revfact[n - m] %
         (int)(1e9 + 7);
}
inline int ADD(int x, int val) {
  int res = x + val;
  while (res >= (int)(1e9 + 7)) res -= (int)(1e9 + 7);
  while (res < 0) res += (int)(1e9 + 7);
  return res;
}
int Solve(vector<pair<int, int> > &black) {
  int dp[2005];
  for (int i = 0; i < ((int)(black).size()); i++) {
    dp[i] = C(black[i].first + black[i].second, black[i].first);
    for (int j = 0; j < i; j++)
      if (black[i].first >= black[j].first &&
          black[i].second >= black[j].second) {
        int wayCount = C(
            black[i].first - black[j].first + black[i].second - black[j].second,
            black[i].first - black[j].first);
        dp[i] = ADD(dp[i], -(1LL * wayCount * dp[j] % (int)(1e9 + 7)));
      }
  }
  return dp[((int)(black).size()) - 1];
}
int main() {
  { ; };
  Setup();
  int h, w, n;
  scanf("%d %d %d", &h, &w, &n);
  vector<pair<int, int> > black;
  for (int i = 0; i < n; i++) {
    int x, y;
    scanf("%d %d", &x, &y);
    x--, y--;
    black.emplace_back(pair<int, int>(x, y));
  }
  black.emplace_back(pair<int, int>(h - 1, w - 1));
  sort((black).begin(), (black).end());
  printf("%d\n", Solve(black));
  return 0;
}
