#include <bits/stdc++.h>
using namespace std;
template <class T>
bool uin(T &a, T b) {
  return a > b ? (a = b, true) : false;
}
template <class T>
bool uax(T &a, T b) {
  return a < b ? (a = b, true) : false;
}
const long long P = 1000000000 + 7;
long long deg(long long x, long long d) {
  d %= P - 1;
  if (d < 0) d += P - 1;
  long long y = 1;
  while (d) {
    if (d & 1) y *= x, y %= P;
    x *= x, x %= P;
    d /= 2;
  }
  return y;
}
const int MAXN = 300000;
long long fact[MAXN], tcaf[MAXN];
long long CNK(int a, int b) { return fact[a] * tcaf[b] % P * tcaf[a - b] % P; }
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.precision(10);
  cout << fixed;
  fact[0] = tcaf[0] = 1;
  for (int i = 1; i <= (int)(MAXN - 1); ++i)
    fact[i] = i * fact[i - 1] % P, tcaf[i] = deg(fact[i], -1);
  int H, W, N;
  cin >> H >> W >> N;
  vector<pair<int, int> > a(N);
  for (int i = 0; i < (int)(N); ++i) cin >> a[i].first >> a[i].second;
  a.push_back(make_pair(H, W));
  sort((a).begin(), (a).end());
  vector<long long> dp(N + 1);
  for (int i = 0; i < (int)(N + 1); ++i) {
    dp[i] = CNK(a[i].first + a[i].second - 2, a[i].first - 1);
    for (int j = 0; j < (int)(i); ++j) {
      if (a[j].first <= a[i].first && a[j].second <= a[i].second) {
        dp[i] -=
            dp[j] * CNK(a[i].first - a[j].first + a[i].second - a[j].second,
                        a[i].first - a[j].first);
        dp[i] %= P;
      }
    }
  }
  long long res = dp[N];
  if (res < 0) res += P;
  cout << res << '\n';
  return 0;
}
