#include <bits/stdc++.h>
using namespace std;
class node {
 public:
  long long int second;
  long long int length;
};
long long int fact[200005];
long long int power(long long int n, long long int k) {
  long long int result = 1;
  while (k > 0) {
    if (k % 2 == 1) result = (result * n) % 1000000007;
    n = (n * n) % 1000000007;
    k = k / 2;
  }
  return result;
}
long long int NC(long long int n, long long int r) {
  long long int val1 = 1, val2 = 1, val3 = 1;
  val1 = fact[n];
  val2 = fact[n - r];
  val3 = fact[r];
  return (val1 * power((val2 * val3) % 1000000007, 1000000005)) % 1000000007;
}
bool compare(pair<long long int, long long int> a,
             pair<long long int, long long int> b) {
  return (a.first <= b.first && a.second <= b.second);
}
int main() {
  long long int r, c, i, h, w, n, j;
  fact[0] = 1;
  for (i = 1; i <= 200004; i++) fact[i] = (fact[i - 1] * i) % 1000000007;
  cin >> h >> w >> n;
  vector<pair<long long int, long long int> > mypair;
  long long int z = n;
  while (n--) {
    scanf("%lld%lld", &r, &c);
    mypair.push_back(make_pair(r - 1, c - 1));
  }
  mypair.push_back(make_pair(h - 1, w - 1));
  long long int arr[z + 2];
  sort(mypair.begin(), mypair.end());
  for (i = 0; i < z + 1; i++)
    arr[i] = NC(mypair[i].first + mypair[i].second, mypair[i].second);
  for (i = 0; i <= z; i++) {
    for (j = 0; j < i; j++) {
      if (mypair[j].first > mypair[i].first ||
          mypair[j].second > mypair[i].second)
        continue;
      arr[i] = (arr[i] - (arr[j] * NC(mypair[i].first + mypair[i].second -
                                          mypair[j].first - mypair[j].second,
                                      mypair[i].second - mypair[j].second)) %
                             1000000007) %
               1000000007;
    }
  }
  cout << (arr[z] + 1000000007) % 1000000007 << endl;
  return 0;
}
