#include <bits/stdc++.h>
using namespace std;
const int SZ = 2000004;
const int MD = 1000000007;
long long F[SZ], I[SZ], p[SZ];
vector<pair<int, int> > data;
long long BPM(long long B, long long P, long long M) {
  long long R = 1;
  while (P > 0) {
    if (P % 2 == 1) {
      R = (R * B) % M;
    }
    P /= 2;
    B = (B * B) % M;
  }
  return R;
}
long long get(pair<int, int> a, pair<int, int> b) {
  long long x = (b.first - a.first + 1), y = (b.second - a.second + 1);
  long long tmp = F[x + y - 2];
  tmp = (tmp * I[y - 1]) % MD;
  tmp = (tmp * I[x + y - 2 - y + 1]) % MD;
  return tmp;
}
int main() {
  F[0] = I[0] = 1;
  for (int i = 1; i < SZ; i++) {
    F[i] = (F[i - 1] * i) % MD;
    I[i] = BPM(F[i], MD - 2, MD);
  }
  long long h, w, n;
  cin >> h >> w >> n;
  for (int i = 0; i < n; i++) {
    long long x, y;
    cin >> x >> y;
    data.push_back(pair<int, int>(x, y));
  }
  sort(data.begin(), data.end());
  for (int i = 0; i < n; i++) {
    p[i] = get(pair<int, int>(1, 1), data[i]);
    for (int j = 0; j < i; j++) {
      if (data[j].first > data[i].first || data[j].second > data[i].second)
        continue;
      p[i] -= (p[j] * get(data[j], data[i])) % MD;
      if (p[i] < 0) p[i] += MD;
    }
  }
  long long ans = get(pair<int, int>(1, 1), pair<int, int>(h, w));
  for (int i = 0; i < n; i++) {
    ans -= (p[i] * get(data[i], pair<int, int>(h, w))) % MD;
    if (ans < 0) ans += MD;
  }
  cout << ans << endl;
}
