#include <bits/stdc++.h>
using namespace std;
long long n, h, w;
vector<pair<long long, long long> > v;
const long long m = 1e9 + 7;
long long f[212345];
long long invf[212345];
long long ways[212345];
long long mpow(long long x, long long y) {
  long long ret = 1;
  while (y) {
    if (y & 1) ret = ret * x % m;
    x = x * x % m;
    y /= 2;
  }
  return ret % m;
}
long long cal(long long x, long long n) {
  return f[x] * invf[x - n] % m * invf[n] % m;
}
int main() {
  f[0] = invf[0] = 1;
  for (int i = 1; i < 212345; i++) {
    f[i] = f[i - 1] * i % m;
    invf[i] = mpow(f[i], m - 2);
  }
  cin >> h >> w >> n;
  bool ok = true;
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    v.push_back({x, y});
    if ((x == 1 && y == 1) or (x == h && y == m)) ok = false;
  }
  if (!ok) {
    cout << 0 << '\n';
    return 0;
  }
  v.push_back({h, w});
  sort(v.begin(), v.end());
  for (int i = 0; i < v.size(); i++) {
    long long x1 = v[i].first;
    long long y1 = v[i].second;
    ways[i] = cal(x1 - 1 + y1 - 1, x1 - 1);
    for (int j = 0; j < i; j++) {
      long long x2 = v[j].first;
      long long y2 = v[j].second;
      ways[i] -= ways[j] * (cal(x1 - x2 + y1 - y2, x1 - x2)) % m;
      while (ways[i] < 0) ways[i] += m;
    }
  }
  cout << ways[n] << '\n';
  return 0;
}
