#include <bits/stdc++.h>
using namespace std;
long long fact[200010], inv[200010];
long long power(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) {
      res *= a;
      res %= 1000000007LL;
    }
    a *= a;
    a %= 1000000007LL;
    b >>= 1;
  }
  return res;
}
void init() {
  fact[0] = 1;
  for (int i = 1; i < 200010; ++i) {
    fact[i] = fact[i - 1] * i;
    fact[i] %= 1000000007LL;
  }
  for (int i = 0; i < 200010; ++i) inv[i] = power(fact[i], 1000000007LL - 2);
}
long long comb(int n, int r) {
  if (r > n) return 0;
  long long res = fact[n];
  res *= inv[r];
  res %= 1000000007LL;
  res *= inv[n - r];
  res %= 1000000007LL;
  return res;
}
int main() {
  init();
  int h, w, n;
  cin >> h >> w >> n;
  vector<pair<int, int> > v(n);
  for (int i = 0; i < n; ++i) cin >> v[i].first >> v[i].second;
  v.push_back(make_pair(h, w));
  sort(v.begin(), v.end());
  vector<long long> ans(v.size(), 0);
  for (int i = 0; i < v.size(); ++i)
    ans[i] = comb(v[i].first + v[i].second - 2, v[i].first - 1);
  for (int i = 0; i < v.size(); ++i)
    for (int j = i + 1; j < v.size(); ++j)
      if (v[j].first >= v[i].first and v[j].second >= v[i].second) {
        ans[j] -=
            ans[i] * comb(v[j].first - v[i].first + v[j].second - v[i].second,
                          v[j].second - v[i].second);
        ans[j] %= 1000000007LL;
        if (ans[j] < 0) ans[j] += 1000000007LL;
      }
  cout << ans.back();
  return 0;
}
