#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 2;
const long long int mod = 1e9 + 7;
int h, w, n;
vector<long long int> fact(300005, 0), inv;
long long int binexpo(long long int x, long long int y) {
  long long int res = 1;
  x = x % mod;
  while (y > 0) {
    if (y & 1) res = (res * x) % mod;
    y = y >> 1;
    x = (x * x) % mod;
  }
  return res;
}
long long int nCrMod(long long int n, long long int r) {
  if (r == 0) return 1;
  return ((fact[n] * inv[n - r]) % mod * inv[r]) % mod;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  cin >> h >> w >> n;
  vector<pair<int, int> > v(n);
  for (int i = 0; i < n; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    v[i] = {a, b};
  }
  v.push_back({h - 1, w - 1});
  sort(v.begin(), v.end());
  fact[0] = 1LL;
  inv = fact;
  for (int i = 1; i <= 300005; i++) {
    fact[i] = (fact[i - 1] * i) % mod;
    inv[i] = binexpo(fact[i], mod - 2) % mod;
  }
  vector<long long int> ways(n + 1);
  long long int c, d;
  for (int i = 0; i < n + 1; i++) {
    ways[i] = (nCrMod(v[i].first + v[i].second, v[i].first) % mod);
    for (int j = 0; j < i; j++) {
      if (v[i].first < v[j].first || v[i].second < v[j].second) continue;
      int x = v[i].first - v[j].first, y = v[i].second - v[j].second;
      c = ways[j];
      d = max(1LL, nCrMod(x + y, x) % mod);
      ways[i] = (ways[i] + mod - (c * d) % mod) % mod;
    }
  }
  cout << ways[n];
}
