#include <bits/stdc++.h>
using namespace std;
const int maxn = 2050;
const int maxm = 300500;
const long long mo = 1e9 + 7;
long long ff[maxm];
long long h, w;
long long dp[maxn];
int n;
struct node {
  long long x, y;
} ww[maxn];
bool cmp(node A, node B) {
  if (A.x + A.y == B.x + B.y) return A.x < B.x;
  return (A.x + A.y) < (B.x + B.y);
}
long long mod_pow(long long x, long long _n) {
  long long res = 1;
  while (_n > 0) {
    if (_n & 1) res = res * x % mo;
    x = x * x % mo;
    _n >>= 1;
  }
  return res;
}
long long C(long long y, long long x) {
  long long rev = mod_pow((ff[x] * ff[y - x]) % mo, mo - 2);
  return (ff[y] * rev) % mo;
}
long long cal(long long u) {
  long long x = ww[u].x, y = ww[u].y;
  if (dp[u] != -1) return dp[u];
  long long &ans = dp[u];
  ans = C(x + y - 2, x - 1);
  long long mid;
  for (int i = 0; i < n; i++) {
    if (ww[i].x <= x && ww[i].y <= y) {
      if (ww[i].x + ww[i].y == x + y) continue;
      mid = (cal(i) * C(x + y - ww[i].x - ww[i].y, x - ww[i].x)) % mo;
      ans = (ans - mid + mo) % mo;
    }
  }
  return ans;
}
int main() {
  ff[0] = 1;
  for (int i = 1; i <= 200500; i++) ff[i] = (ff[i - 1] * i) % mo;
  while (scanf("%lld%lld%d", &h, &w, &n) == 3) {
    for (int i = 0; i < n; i++) scanf("%lld%lld", &ww[i].x, &ww[i].y);
    memset(dp, -1, sizeof dp);
    ww[n].x = h;
    ww[n].y = w;
    n++;
    sort(ww, ww + n, cmp);
    printf("%lld\n", cal(n - 1));
  }
  return 0;
}
