#include <bits/stdc++.h>
using namespace std;
const long long N = 3e6 + 9, mod = 1e9 + 7;
long long f[N], n, m, t, inv[N], fac[N];
pair<long long, long long> a[N];
inline void Init() {
  fac[1] = fac[0] = inv[0] = inv[1] = 1;
  for (long long i = 2; i < N - 1; i++) fac[i] = 1ll * fac[i - 1] * i % mod;
  for (long long i = 2; i < N - 1; i++)
    inv[i] = 1ll * (mod - mod / i) * inv[mod % i] % mod;
  for (long long i = 2; i < N - 1; i++)
    inv[i] = 1ll * inv[i] * inv[i - 1] % mod;
}
inline long long C(long long n, long long m) {
  return 1ll * fac[n] * inv[m] % mod * inv[n - m] % mod;
}
signed main() {
  scanf("%lld%lld%lld", &n, &m, &t);
  Init();
  for (long long i = 1; i <= t; i++)
    scanf("%lld%lld", &a[i].first, &a[i].second);
  sort(a + 1, a + 1 + t);
  a[t + 1] = make_pair(n, m);
  for (long long i = 1; i <= t + 1; i++) {
    f[i] = C(a[i].first - 1 + a[i].second - 1, a[i].first - 1);
    for (long long j = 1; j < i; j++)
      if (a[j].first <= a[i].first && a[j].second <= a[i].second)
        f[i] = (f[i] -
                1ll * f[j] *
                    C(a[i].first - a[j].first + a[i].second - a[j].second,
                      a[i].first - a[j].first) %
                    mod +
                mod) %
               mod;
  }
  printf("%lld", f[t + 1]);
  return 0;
}
