#include <bits/stdc++.h>
using namespace std;
const int Maxn = 200020, M = 1e9 + 7;
int rev[Maxn], fac[Maxn];
int dp[Maxn];
vector<pair<int, int> > V;
int C(int x, int y) {
  return fac[x] * (long long)rev[y] % M * (long long)rev[x - y] % M;
}
int cal(int xx1, int yy1, int xx2, int yy2) {
  xx1 = xx2 - xx1;
  yy1 = yy2 - yy1;
  if (xx1 < 0 || yy1 < 0) return 0;
  return C(xx1 + yy1, xx1);
}
int main() {
  rev[0] = rev[1] = 1;
  fac[0] = fac[1] = 1;
  for (int i = 2; i < Maxn; i++)
    fac[i] = fac[i - 1] * (long long)i % M,
    rev[i] = (M - M / i) * (long long)rev[M % i] % M;
  for (int i = 2; i < Maxn; i++) rev[i] = rev[i - 1] * (long long)rev[i] % M;
  int h, w, n;
  scanf("%d%d%d", &h, &w, &n);
  V.push_back(pair<int, int>(1, 1));
  V.push_back(pair<int, int>(h, w));
  for (int i = 0; i < n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    V.push_back(pair<int, int>(x, y));
  }
  sort(V.begin(), V.end());
  dp[0] = 1;
  for (int i = 1; i < V.size(); i++) {
    pair<int, int> u = V[i];
    int x = u.first, y = u.second;
    dp[i] = cal(1, 1, x, y);
    for (int j = 1; j < i; j++) {
      dp[i] -= cal(V[j].first, V[j].second, x, y) * (long long)dp[j] % M;
      if (dp[i] < 0) dp[i] += M;
    }
  }
  printf("%d\n", dp[V.size() - 1]);
}
