#include <bits/stdc++.h>
using namespace std;
pair<int, int> v[2010];
long long ans, qtd[2010];
long long fat[200100];
long long inv[200100];
int h, w, n;
long long fast(long long a, long long b) {
  if (b == 0) return 1;
  long long res = fast(a, b / 2);
  res *= res;
  if (res >= 1000000007LL) res %= 1000000007LL;
  if (b & 1) res *= a;
  if (res >= 1000000007LL) res %= 1000000007LL;
  return res;
}
void ini() {
  fat[0] = 1;
  inv[0] = 1;
  for (long long i = 1; i < 200100; ++i) {
    fat[i] = (fat[i - 1] * i) % 1000000007LL;
    inv[i] = fast(fat[i], 1000000007LL - 2);
  }
}
long long c(int a, int b) {
  long long res = (fat[b] * inv[a]) % 1000000007LL;
  res = (res * inv[b - a]) % 1000000007LL;
  return res;
}
int main() {
  long long tira = 0;
  ini();
  cin >> h >> w >> n;
  for (int i = 0; i < n; ++i) {
    cin >> v[i].first >> v[i].second;
  }
  sort(v, v + n);
  for (int i = 0; i < n; ++i) {
    qtd[i] = c(v[i].second - 1, v[i].second + v[i].first - 2);
    for (int j = 0; j < i; ++j) {
      if (v[j].first > v[i].first || v[j].second > v[i].second) continue;
      long long aux =
          qtd[j] * c(v[i].second - v[j].second,
                     (v[i].second - v[j].second) + (v[i].first - v[j].first));
      if (aux >= 1000000007LL) aux %= 1000000007LL;
      qtd[i] -= aux;
      if (qtd[i] < 0) qtd[i] += 1000000007LL;
      if (qtd[i] >= 1000000007LL) qtd[i] %= 1000000007LL;
    }
    tira +=
        (qtd[i] * c(w - v[i].second, (w - v[i].second) + (h - v[i].first))) %
        1000000007LL;
    if (tira >= 1000000007LL) tira %= 1000000007LL;
  }
  ans = (c(w - 1, h + w - 2) - tira + 2LL * 1000000007LL) % 1000000007LL;
  cout << ans << "\n";
  return 0;
}
