#include <bits/stdc++.h>
using namespace std;
long long n, m, k, fact[2 * 100000 + 10], dp[2000 + 10];
pair<long long, long long> v[2000 + 10];
void precalc() {
  fact[0] = 1;
  for (int i = 1; i <= 2 * 100000; i++) fact[i] = fact[i - 1] * i % 1000000007;
}
long long lgput(long long a, long long n) {
  if (!n) return 1;
  if (n % 2 == 0) return lgput(a * a % 1000000007, n / 2);
  return a * lgput(a * a % 1000000007, n / 2) % 1000000007;
}
long long C(long long n, long long k) {
  long long val1 = fact[n], val2 = fact[k] * fact[n - k] % 1000000007;
  return val1 * lgput(val2, 1000000007 - 2) % 1000000007;
}
bool mycmp(pair<long long, long long> a, pair<long long, long long> b) {
  if (a.first < b.first) return 1;
  if (a.first == b.first && a.second < b.second) return 1;
  return 0;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> k;
  for (int i = 1; i <= k; i++) cin >> v[i].first >> v[i].second;
  sort(v + 1, v + k + 1, mycmp);
  precalc();
  for (int i = 1; i <= k; i++) {
    long long val = C(v[i].first + v[i].second - 2, v[i].second - 1);
    for (int j = i - 1; j; j--) {
      if (v[j].second > v[i].second) continue;
      val = val - C(v[i].first - v[j].first + v[i].second - v[j].second,
                    v[i].second - v[j].second) *
                      dp[j] % 1000000007;
      val = (val + 1000000007) % 1000000007;
    }
    dp[i] = val;
  }
  long long val = C(n + m - 2, m - 1);
  for (int i = 1; i <= k; i++) {
    val = val - C(n - v[i].first + m - v[i].second, m - v[i].second) * dp[i] %
                    1000000007;
    val = (val + 1000000007) % 1000000007;
  }
  cout << val << '\n';
  return 0;
}
