#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int N = 200100;
const long long mod = 1e9 + 7;
long long fac[N];
long long dp[2020];
long long h, w, n;
struct node {
  long long x, y;
  bool operator<(const node &rhs) const {
    if (rhs.x == x) return y < rhs.y;
    return x < rhs.x;
  }
} a[2020];
long long exgcd(long long a, long long b, long long &x, long long &y) {
  if (!b) {
    x = 1;
    y = 0;
    return a;
  }
  long long gcd = exgcd(b, a % b, x, y);
  long long t = x;
  x = y;
  y = t - (a / b) * x;
  return gcd;
}
long long inverse(long long num) {
  long long x, y;
  exgcd(num, mod, x, y);
  return (x % mod + mod) % mod;
}
long long C(int a, int b) {
  long long t1 = fac[a];
  long long t2 = (long long)fac[a - b] * fac[b] % mod;
  long long inv = inverse(t2);
  return t1 * inv % mod;
}
void fac_init() {
  fac[0] = 1;
  for (int i = 1; i <= N - 90; ++i) fac[i] = fac[i - 1] * i % mod;
}
int main() {
  fac_init();
  while (~scanf("%lld%lld%lld", &h, &w, &n)) {
    for (int i = 1; i <= n; ++i) {
      scanf("%lld%lld", &a[i].x, &a[i].y);
    }
    sort(a + 1, a + 1 + n);
    a[++n].x = h;
    a[n].y = w;
    for (int i = 1; i <= n; ++i) {
      long long x1 = a[i].x, y1 = a[i].y;
      dp[i] = C(x1 + y1 - 2, x1 - 1);
      for (int j = 1; j < i; ++j) {
        long long x2 = a[j].x, y2 = a[j].y;
        if (x2 <= x1 && y2 <= y1) {
          dp[i] -= (dp[j] * C(x1 + y1 - x2 - y2, x1 - x2)) % mod;
          dp[i] = (dp[i] % mod + mod) % mod;
        }
      }
    }
    printf("%lld\n", dp[n]);
  }
  return 0;
}
