#include <bits/stdc++.h>
using namespace std;
void gcd_extended(long long int a, long long int b, long long int* x,
                  long long int* y) {
  if (b == 0) {
    *x = 1;
    *y = 0;
    return;
  }
  long long int x1, y1;
  gcd_extended(b, a % b, &x1, &y1);
  *x = y1;
  *y = x1 - (a / b) * y1;
  return;
}
long long int fact[200001], inv[200001];
struct points {
  int x, y;
} p[2001];
bool fun(points p1, points p2) {
  if (p1.x != p2.x)
    return p1.x < p2.x;
  else
    return p1.y < p2.y;
}
void initialise() {
  int i, j;
  fact[0] = 1;
  for (i = 1; i <= 200000; i++) {
    fact[i] = fact[i - 1] * i;
    fact[i] %= 1000000007;
  }
  long long int x, y;
  gcd_extended(fact[200000], 1000000007, &x, &y);
  x += 1000000007;
  x %= 1000000007;
  inv[200000] = x;
  for (i = 200000 - 1; i >= 0; i--) {
    inv[i] = inv[i + 1] * (i + 1);
    inv[i] %= 1000000007;
  }
  return;
}
int main() {
  initialise();
  int i, j, h, w, n;
  scanf("%d %d %d", &h, &w, &n);
  for (i = 0; i < n; i++) {
    scanf("%d %d", &p[i].y, &p[i].x);
  }
  p[n].y = h;
  p[n].x = w;
  sort(p, p + n + 1, fun);
  long long int dp[n + 1];
  for (i = 0; i <= n; i++) {
    dp[i] = fact[p[i].x - 1 + p[i].y - 1];
    dp[i] *= inv[p[i].x - 1];
    dp[i] %= 1000000007;
    dp[i] *= inv[p[i].y - 1];
    dp[i] %= 1000000007;
  }
  for (i = 0; i <= n; i++) {
    for (j = 0; j < i; j++) {
      if (p[j].y > p[i].y) continue;
      long long int temp = fact[p[i].y - p[j].y + p[i].x - p[j].x];
      temp *= inv[p[i].y - p[j].y];
      temp %= 1000000007;
      temp *= inv[p[i].x - p[j].x];
      temp %= 1000000007;
      dp[i] -= dp[j] * temp;
      dp[i] %= 1000000007;
    }
  }
  printf("%lld\n", (dp[n] + 1000000007) % 1000000007);
  return 0;
}
