#include <bits/stdc++.h>
using namespace std;
pair<int, int> a[2005];
int n, h, w;
long long fact[300009], ifact[300009], inv[300009], ans[300009],
    mod = 1000000007;
inline void adjust(long long &x) {
  if (x >= mod) {
    x -= mod;
  }
  if (x < 0) {
    x += mod;
  }
}
inline void factt() {
  fact[0] = 1;
  for (long long i = 1; i < 300009; i++) {
    fact[i] = fact[i - 1] * i;
    fact[i] %= mod;
  }
  inv[1] = 1;
  for (long long i = 2; i < 300009; i++) {
    inv[i] = mod - ((mod / i) * inv[mod % i]) % mod;
    adjust(inv[i]);
  }
  ifact[0] = ifact[1] = 1;
  for (int i = 2; i < 300009; i++) {
    ifact[i] = ifact[i - 1] * inv[i];
    ifact[i] %= mod;
  }
}
inline long long comp(int i, int j) {
  int n1 = a[j].first - a[i].first;
  int n2 = a[j].second - a[i].second;
  long long res = fact[n1 + n2];
  res = res * ifact[n1];
  res %= mod;
  res = res * ifact[n2];
  res %= mod;
  return res;
}
inline void compute() {
  for (int i = 1; i <= n + 1; i++) {
    ans[i] = comp(0, i);
  }
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n + 1; j++) {
      if (a[j].second >= a[i].second) {
        ans[j] = ans[j] - (ans[i] * comp(i, j)) % mod;
        adjust(ans[j]);
      }
    }
  }
}
int main() {
  scanf("%d", &h);
  scanf("%d", &w);
  scanf("%d", &n);
  a[0].first = 1;
  a[0].second = 1;
  factt();
  for (int i = 1; i <= n; i++) {
    int x, y;
    scanf("%d", &a[i].first);
    scanf("%d", &a[i].second);
  }
  a[n + 1].first = h;
  a[n + 1].second = w;
  sort(a, a + n + 2);
  compute();
  printf("%lld\n", ans[n + 1]);
}
