#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pli = pair<ll, int>;
const int INF = 0x3f3f3f3f, N = 2e5 + 5;
const ll LINF = 1e18 + 5;
constexpr int mod = 1e9 + 7;
int h, w, n;
pii b[N];
ll fac[N], inv[N], dp[N];
ll powmod(ll a, ll b) {
  a %= mod;
  ll ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return ans;
}
void init(int n) {
  fac[0] = 1;
  for (int i = 1; i <= n; i++) fac[i] = fac[i - 1] * i % mod;
  inv[n] = powmod(fac[n], mod - 2);
  for (int i = n - 1; i >= 0; i--) inv[i] = inv[i + 1] * (i + 1) % mod;
}
ll comp(ll a, ll b) {
  if (a < b || b < 0) return 0;
  return fac[a] * inv[b] % mod * inv[a - b] % mod;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> h >> w >> n;
  init(h + w);
  for (int i = 0; i < n; i++) cin >> b[i].first >> b[i].second;
  sort(b, b + n,
       [](pii c, pii d) { return c.first + c.second < d.first + d.second; });
  b[n] = {h, w};
  dp[0] = comp(b[0].first + b[0].second - 2, b[0].first - 1);
  for (int i = 1; i <= n; i++) {
    dp[i] = comp(b[i].first + b[i].second - 2, b[i].first - 1);
    for (int j = 0; j < i; j++) {
      if (b[j].first > b[i].first || b[j].second > b[i].second) continue;
      dp[i] -= comp(b[i].first + b[i].second - b[j].first - b[j].second,
                    b[i].first - b[j].first) *
               dp[j] % mod;
      dp[i] = (dp[i] % mod + mod) % mod;
    }
    dp[i] = (dp[i] + mod) % mod;
  }
  if (dp[n] < 0) dp[n] = (dp[n] + mod) % mod;
  cout << dp[n];
  return 0;
}
