#include <bits/stdc++.h>
int dx[] = {0, 1, -1, 0, 1, -1, 1, -1, -2, 2, 0, 0},
    dy[] = {1, 0, 0, -1, -1, 1, 1, -1, 0, 0, -2, 2};
using namespace std;
long long N[200005], D[200005];
const int M = 1e9 + 7;
long long dp[3000];
long long POWER(int b, int e) {
  if (e == 0) return 1;
  if (e & 1)
    return (POWER(b, e - 1) % M * b) % M;
  else {
    long long t = POWER(b, e / 2) % M;
    return t * t % M;
  }
}
long long C(int n, int r) {
  if (n == r) return 1;
  return N[n] * ((D[r] * D[n - r]) % M) % M;
}
int main() {
  N[1] = 1, D[1] = 1;
  N[0] = D[0] = 1;
  for (int i = 2; i < 200004; i++) {
    N[i] = (N[i - 1] * i) % M;
    D[i] = POWER(N[i], M - 2);
  }
  int h, w, n;
  cin >> h >> w >> n;
  long long ans = C(h + w - 2, h - 1);
  vector<pair<int, int> > black;
  for (int i = 0; i < n; i++) {
    int a, b;
    cin >> a >> b;
    black.push_back(make_pair(a, b));
  }
  black.push_back(make_pair(h, w));
  sort(black.begin(), black.end());
  for (int i = 0; i < black.size(); i++) {
    int x = black[i].first, y = black[i].second;
    dp[i] = C(x + y - 2, x - 1);
    for (int j = 0; j < i; j++) {
      int a = black[j].first, b = black[j].second;
      if (y >= b) {
        dp[i] -= (dp[j] * C(x - a + y - b, x - a) % M);
        dp[i] = (dp[i] + M) % M;
      }
    }
  }
  cout << dp[black.size() - 1] << endl;
}
