#include <bits/stdc++.h>
using namespace std;
long long int fact[200005];
long long int infact[200005];
long long int ways[100005];
vector<pair<long long int, long long int> > v;
long long int modpow(long long int a, long long int b) {
  long long int ret = 1;
  while (b > 0) {
    if (b & 1) {
      ret *= a;
      if (ret >= 1000000007) ret %= 1000000007;
    }
    a *= a;
    b /= 2;
    if (a >= 1000000007) a %= 1000000007;
  }
  return ret;
}
long long int inverse(long long int val) { return modpow(val, 1000000007 - 2); }
int main() {
  infact[0] = fact[0] = 1;
  for (int i = 1; i <= 200001; i++) {
    fact[i] = (i * fact[i - 1]) % 1000000007;
    infact[i] = inverse(fact[i]);
  }
  int h, w, n;
  cin >> h >> w >> n;
  v.push_back(make_pair(h, w));
  for (int i = 1; i <= n; i++) {
    int x, y;
    cin >> x >> y;
    v.push_back(make_pair(x, y));
  }
  sort(v.begin(), v.end());
  for (int i = 0; i < v.size(); i++) {
    ways[i] = fact[v[i].first - 1 + v[i].second - 1];
    ways[i] = (ways[i] * infact[v[i].first - 1]) % 1000000007;
    ways[i] = (ways[i] * infact[v[i].second - 1]) % 1000000007;
  }
  for (int i = 0; i < v.size(); i++) {
    for (int j = i + 1; j < v.size(); j++) {
      if (v[j].first < v[i].first or v[j].second < v[i].second) continue;
      long long int val =
          fact[v[j].second - v[i].second + v[j].first - v[i].first];
      long long int val1 = (infact[v[j].second - v[i].second] *
                            infact[v[j].first - v[i].first]) %
                           1000000007;
      val = (val * val1) % 1000000007;
      ways[j] -= (ways[i] * val) % 1000000007;
      ways[j] = (ways[j] + 1000000007) % 1000000007;
    }
  }
  cout << ways[v.size() - 1] << endl;
  return 0;
}
