#include <bits/stdc++.h>
using namespace std;
const int P = 1e9 + 7;
const int N = 2e5 + 5;
const int maxn = 2005;
void read(int &x) { scanf("%d", &x); }
struct node {
  int x, y, v;
  void rd() {
    read(x), read(y);
    x--, y--;
    v = x + y;
  }
  bool operator<(const node &A) const { return v < A.v; }
} a[maxn];
int n, m, k;
long long dp[maxn];
long long inv[N], fact[N], fact_inv[N];
void init() {
  inv[1] = fact[0] = fact_inv[0] = 1;
  int nm = n + m;
  for (int i = 2; i <= nm; i++) inv[i] = (P - P / i * inv[P % i] % P) % P;
  for (int i = 1; i <= nm; i++) {
    fact[i] = fact[i - 1] * i % P;
    fact_inv[i] = fact_inv[i - 1] * inv[i] % P;
  }
}
long long Com(int n, int m) {
  return fact[n] * fact_inv[n - m] % P * fact_inv[m] % P;
}
int main() {
  read(n), read(m), read(k);
  init();
  for (int i = 1; i <= k; i++) a[i].rd();
  a[0] = (node){-1, -1, -2};
  a[++k] = (node){n - 1, m - 1, n + m - 2};
  sort(a + 1, a + k + 1);
  dp[0] = 1;
  for (int i = 1; i <= k; i++) {
    dp[i] = Com(a[i].v, a[i].x);
    for (int j = 1; j <= i - 1; j++)
      if (a[i].x >= a[j].x && a[i].y >= a[j].y)
        dp[i] =
            (dp[i] -
             dp[j] * Com(a[i].x - a[j].x + a[i].y - a[j].y, a[i].x - a[j].x) %
                 P +
             P) %
            P;
  }
  printf("%lld", dp[k]);
}
