#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 9;
const long long MOD = 1e9 + 7;
const int mod = 998244353;
inline long long qpow(long long b, long long e, long long m) {
  long long a = 1;
  for (; e; e >>= 1, b = b * b % m)
    if (e & 1) a = a * b % m;
  return a;
}
long long exgcd(long long a, long long b, long long &x, long long &y) {
  if (b == 0) {
    x = 1, y = 0;
    return a;
  }
  long long d = exgcd(b, a % b, x, y);
  long long z = x;
  x = y, y = z - y * (a / b);
  return d;
}
long long dp[maxn];
long long fac[maxn], _inv[maxn], finv[maxn];
void pre(int MOD) {
  _inv[0] = _inv[1] = 1;
  for (long long i = 2; i < maxn; i++)
    _inv[i] = ((MOD - MOD / i) * _inv[MOD % i]) % MOD;
  fac[0] = 1;
  finv[0] = 1;
  for (int i = 1; i < maxn; i++) {
    fac[i] = fac[i - 1] * i % MOD;
    finv[i] = finv[i - 1] * _inv[i] % MOD;
  }
};
struct node {
  int x, y;
} a[maxn];
bool operator<(node A, node B) {
  if (A.x == B.x) return A.y < B.y;
  return A.x < B.x;
}
long long C(long long n, long long m, long long p) {
  if (m > n || m < 0) return 0;
  return ((fac[n] * finv[m]) % p * finv[n - m] % p) % p;
}
int main() {
  pre(MOD);
  int h, w, n;
  scanf("%d%d%d", &h, &w, &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &a[i].x, &a[i].y);
  }
  a[n + 1] = {h, w};
  sort(a + 1, a + n + 2);
  for (int i = 1; i <= n + 1; i++) {
    dp[i] = C(a[i].x + a[i].y - 2, a[i].x - 1, MOD);
    for (int j = 1; j < i; j++) {
      dp[i] -= dp[j] *
               C(a[i].x - a[j].x + a[i].y - a[j].y, a[i].x - a[j].x, MOD) % MOD;
      dp[i] %= MOD;
    }
    dp[i] = (dp[i] + MOD) % MOD;
  }
  printf("%lld\n", dp[n + 1]);
}
