#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const int maxh = 200001, maxn = 20002;
long long pm(long long a, long long n) {
  long long ret = 1, p = MOD;
  for (a %= p; n; n >>= 1, a = a * a % p)
    if (n & 1) ret = ret * a % p;
  return ret;
}
long long inv(long long a) { return pm(a, MOD - 2); }
struct VEC {
  int r, c;
  bool operator<(const VEC b) const { return r != b.r ? r < b.r : c < b.c; }
};
int h, w, n;
VEC blk[maxn];
long long fact[maxh * 2], ivf[maxh];
long long f[maxn];
long long cal(long long r, long long c) {
  return fact[r + c - 2] * ivf[c - 1] % MOD * ivf[r - 1] % MOD;
}
int main() {
  fact[0] = 1;
  for (int i = 1; i <= 200000; i++) fact[i] = fact[i - 1] * i % MOD;
  for (int i = 0; i <= 100000; i++) ivf[i] = inv(fact[i]);
  scanf("%d%d%d", &h, &w, &n);
  for (int i = 1; i <= n; i++) scanf("%d%d", &blk[i].r, &blk[i].c);
  blk[++n] = (VEC){h, w};
  sort(blk + 1, blk + 1 + n);
  for (int i = 1; i <= n; i++) {
    f[i] = cal(blk[i].r, blk[i].c);
    for (int j = 1; j < i; j++)
      if (blk[i].r >= blk[j].r && blk[i].c >= blk[j].c) {
        f[i] = (f[i] -
                f[j] * cal(blk[i].r - blk[j].r + 1, blk[i].c - blk[j].c + 1) %
                    MOD +
                MOD) %
               MOD;
      }
  }
  cout << f[n] << endl;
  return 0;
}
