#include <bits/stdc++.h>
using namespace std;
static long long int fact[2 * 100005], inv[2 * 100005], T[2005];
long long int powm(long long int a, long long int p) {
  if (p == 0) return 1;
  long long int t = powm(a, p / 2);
  t = (t * t) % 1000000007;
  if (p % 2 == 1)
    return (a * t) % 1000000007;
  else
    return t;
}
void init() {
  fact[0] = fact[1] = 1;
  inv[1] = 1;
  for (long long int i = 2; i < 2 * 100005; i++) {
    fact[i] = (fact[i - 1] * i) % 1000000007;
    inv[i] = powm(i, 1000000007 - 2);
  }
}
long long int ncr(long long int n, long long int r) {
  long long int t = fact[n - r];
  t = (t * fact[r]) % 1000000007;
  if (t < 2 * 100005)
    t = inv[t];
  else
    t = powm(t, 1000000007 - 2);
  t = (t * fact[n]) % 1000000007;
  return t;
}
int main() {
  int h, w, n, x, y, t;
  init();
  vector<pair<long long int, long long int> > v;
  scanf("%d", &h);
  scanf("%d", &w);
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &x);
    scanf("%d", &y);
    v.push_back(make_pair((long long int)x, (long long int)y));
  }
  v.push_back(make_pair(h, w));
  n++;
  sort(v.begin(), v.end());
  for (int i = 0; i < n; i++) {
    T[i] = ncr(v[i].first + v[i].second - 2, v[i].first - 1);
    for (int j = 0; j < i; j++) {
      if (v[j].second <= v[i].second) {
        t = ncr(v[i].first + v[i].second - v[j].first - v[j].second,
                v[i].first - v[j].first);
        t = (T[j] * t) % 1000000007;
        T[i] = (T[i] + 1000000007 - t) % 1000000007;
      }
    }
  }
  cout << T[n - 1] << "\n";
  return 0;
}
