#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
using namespace std;
long long max3(long long x, long long y, long long z) {
  return max(max(x, y), z);
}
long long min3(long long x, long long y, long long z) {
  return min(min(x, y), z);
}
const long long N = 1e5 + 10, M = 2e5 + 10, M2 = 1e6 + 10, mod = 1e9 + 7,
                inf = 1e17 + 10;
const long long INF = 1e9 + 7;
void add(long long &a, long long b) {
  a += b;
  if (a >= mod) {
    a -= mod;
  }
}
void sub(long long &a, long long b) {
  a -= b;
  if (a < 0) {
    a += mod;
  }
}
template <typename Arg1>
void __f(const char *name, Arg1 &&arg1) {
  cerr << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char *names, Arg1 &&arg1, Args &&...args) {
  const char *comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
long long X[] = {0, 1, 0, -1};
long long Y[] = {-1, 0, 1, 0};
long long power(long long x, long long n) {
  long long result = 1;
  while (n > 0) {
    if (n % 2 == 1) result = (result * x) % mod;
    x = ((x % mod) * (x % mod)) % mod;
    n = n / 2;
  }
  return result;
}
long long h, w, n;
long long r, c;
vector<pair<long long, long long> > v;
long long fac[200005];
long long invfac[200005];
void precal() {
  fac[0] = 1;
  invfac[0] = power(fac[0], mod - 2);
  for (long long i = 1; i < 200005; i++) {
    fac[i] = (i * fac[i - 1]) % mod;
    invfac[i] = power(fac[i], mod - 2);
  }
}
long long ncr(long long n, long long r) {
  long long res = (fac[n] * invfac[r]) % mod;
  res = (res * invfac[n - r]) % mod;
  return res;
}
long long dp[200005];
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  precal();
  cin >> h >> w >> n;
  for (long long i = 0; i < n; i++) {
    cin >> r >> c;
    v.push_back({r, c});
  }
  v.push_back({h, w});
  sort(v.begin(), v.end());
  for (long long i = 0; i <= n; i++) {
    dp[i] = ncr(v[i].first + v[i].second - 2, v[i].first - 1);
    for (long long j = 0; j < i; j++) {
      if (v[i].first >= v[j].first && v[i].second >= v[j].second) {
        dp[i] -=
            (dp[j] * ncr(v[i].first - v[j].first + v[i].second - v[j].second,
                         v[i].first - v[j].first));
        dp[i] %= mod;
        if (dp[i] < 0) dp[i] += mod;
      }
    }
  }
  cout << dp[n];
  return 0;
}
