#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5, MOD = 1e9 + 7;
int n, m, k, f[N], of[N], dp[N];
pair<int, int> a[N];
inline int binpow(int a, int n) {
  int res = 1;
  while (n) {
    if (n & 1) {
      res = (1ll * res * a) % MOD;
    }
    a = (1ll * a * a) % MOD;
    n >>= 1;
  }
  return res;
}
inline int C(int N, int K) {
  return (1ll * (1ll * f[N] * of[K] % MOD) * of[N - K]) % MOD;
}
inline int get(int x1, int y1, int x2, int y2) {
  int K = x2 - x1, N = y2 + x2 - x1 - y1;
  return C(N, K);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  f[0] = of[0] = 1;
  for (int i = 1; i < N; i++) {
    f[i] = (1ll * f[i - 1] * i) % MOD;
    of[i] = binpow(f[i], MOD - 2);
  }
  cin >> n >> m >> k;
  for (int i = 1; i <= k; i++) {
    cin >> a[i].first >> a[i].second;
  }
  sort(a + 1, a + k + 1);
  a[++k] = make_pair(n, m);
  for (int i = 1; i <= k; i++) {
    dp[i] = get(1, 1, a[i].first, a[i].second);
    for (int j = 1; j < i; j++) {
      dp[i] = (dp[i] -
               (1ll * dp[j] *
                get(a[j].first, a[j].second, a[i].first, a[i].second)) %
                   MOD +
               MOD) %
              MOD;
    }
  }
  cout << dp[k];
}
