#include <bits/stdc++.h>
using namespace std;
long long f[222222], fh[222222], sum[222222], Row, Col, K, A, B, C;
vector<pair<long long, pair<long long, long long> > > vec;
inline long long combin(long long x, long long y) {
  return (f[x] * fh[y]) % 1000000007 * fh[x - y] % 1000000007;
}
int main() {
  f[0] = f[1] = fh[0] = 1LL;
  fh[200000] = 750007460;
  for (int i = 2; i <= 200000; ++i) f[i] = (i * f[i - 1]) % 1000000007;
  for (int i = 199999; i > 0; --i) fh[i] = (fh[i + 1] * (i + 1)) % 1000000007;
  cin >> Row >> Col >> K;
  for (int i = 1; i <= K; ++i) {
    cin >> A >> B;
    C = (A + B + 1000000007) % 1000000007;
    vec.push_back({A, {B, C}});
  }
  vec.push_back({Row, {Col, Row + Col}});
  sort(vec.begin(), vec.end());
  for (int i = 1; i <= K + 1; ++i) {
    sum[i] = combin(vec[i - 1].second.second - 2, vec[i - 1].first - 1);
    for (int j = 1; j < i; ++j) {
      if (vec[j - 1].second.first <= vec[i - 1].second.first)
        sum[i] =
            ((sum[i] -
              sum[j] *
                  (combin(vec[i - 1].second.second - vec[j - 1].second.second,
                          vec[i - 1].first - vec[j - 1].first) +
                   1000000007) %
                  1000000007) +
             1000000007) %
            1000000007;
    }
  }
  cout << sum[K + 1] << endl;
}
