#include <bits/stdc++.h>
using namespace std;
long long INF = LLONG_MAX;
int const mxn = 2e3 + 3;
int const mx = 2e5 + 5;
long long dp[mxn];
long long fac[mx], ifac[mx];
long long modpow(long long a, long long b) {
  long long r = 1;
  while (b) {
    if (b & 1) r = (r * a) % 1000000007;
    a = (a * a) % 1000000007;
    b >>= 1;
  }
  return r;
}
long long calc(pair<int, int> coor, pair<int, int> coor2) {
  int x1 = coor.first, y1 = coor.second;
  int x2 = coor2.first, y2 = coor2.second;
  int disx = x2 - x1;
  int disy = y2 - y1;
  if (disx < 0 || disy < 0) return 0;
  return (((fac[disx + disy] * ifac[disx]) % 1000000007) * ifac[disy]) %
         1000000007;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int h, w, n;
  cin >> h >> w >> n;
  fac[0] = 1LL;
  ifac[0] = 1LL;
  for (int i = 1; i < mx; i++) {
    fac[i] = fac[i - 1] * i % 1000000007;
    ifac[i] = modpow(fac[i], 1000000007 - 2);
  }
  pair<int, int> black[n + 1];
  for (int i = 0; i < n; i++) {
    cin >> black[i].first >> black[i].second;
    dp[i] = 0LL;
  }
  dp[n] = 0LL;
  black[n].first = h;
  black[n].second = w;
  sort(black, black + n + 1);
  for (int i = 0; i <= n; i++) dp[i] = calc(pair<int, int>(1, 1), black[i]);
  for (int i = 0; i <= n; i++)
    for (int j = 0; j < i; j++)
      if (black[j] < black[i])
        dp[i] =
            (dp[i] -
             (dp[j] * (calc(black[j], black[i]) + 1000000007) % 1000000007) %
                 1000000007 +
             1000000007) %
            1000000007;
  cout << dp[n] << endl;
}
