#include <bits/stdc++.h>
using namespace std;
const int maxn = 2000 + 10;
const long long mod = 1000000007;
long long dp[maxn];
struct point {
  int x, y;
  bool operator<(const point &rhs) const { return (x + y) < (rhs.x + rhs.y); }
} P[maxn];
long long fax[100005 * 2];
void init() {
  int n = 100000 * 2;
  fax[0] = 1;
  for (int i = 1; i <= n; i++) fax[i] = (fax[i - 1] * i) % mod;
}
void gcd(long long a, long long b, long long &d, long long &x, long long &y) {
  if (b == 0) {
    d = a;
    x = 1;
    y = 0;
  } else {
    gcd(b, a % b, d, y, x);
    y -= x * (a / b);
  }
}
long long inv(long long a, long long n) {
  long long d, x, y;
  gcd(a, n, d, x, y);
  return (x + n) % n;
}
long long lucas(int n, int m) {
  long long ans = 1;
  while (n && m) {
    int a = n % mod, b = m % mod;
    if (a < b) return 0;
    ans = (((ans * fax[a]) % mod) * inv(fax[b] * fax[a - b], mod)) % mod;
    n /= mod;
    m /= mod;
  }
  return ans;
}
int main() {
  int h, w, n;
  init();
  while (scanf("%d%d%d", &h, &w, &n) == 3) {
    for (int i = 0; i < n; i++) {
      scanf("%d%d", &P[i].x, &P[i].y);
    }
    P[n].x = h;
    P[n].y = w;
    sort(P, P + n + 1);
    for (int i = 0; i <= n; i++) {
      dp[i] = lucas(P[i].x + P[i].y - 2, P[i].y - 1);
      for (int j = 0; j < i; j++)
        if (P[i].x >= P[j].x && P[i].y >= P[j].y) {
          dp[i] = ((dp[i] - (dp[j] * lucas(P[i].x - P[j].x + P[i].y - P[j].y,
                                           P[i].x - P[j].x)) %
                                mod) +
                   mod) %
                  mod;
        }
    }
    printf("%I64d\n", dp[n]);
  }
  return 0;
}
