#include <bits/stdc++.h>
using namespace std;
const int M = 2e5 + 5;
const int mod = 1e9 + 7;
int quick_pow(int x, int y) {
  int res = 1;
  while (y) {
    if (y & 1) res = (long long)res * x % mod;
    x = (long long)x * x % mod;
    y >>= 1;
  }
  return res;
}
int fac[M], env[M];
void init() {
  fac[0] = env[0] = 1;
  for (int i = 1; i < M; i++) fac[i] = (long long)fac[i - 1] * i % mod;
  env[M - 1] = quick_pow(fac[M - 1], mod - 2);
  for (int i = M - 2; i >= 1; i--)
    env[i] = (long long)env[i + 1] * (i + 1) % mod;
}
int C(int n, int m) {
  if (m > n) return 0;
  return (long long)fac[n] * env[m] % mod * env[n - m] % mod;
}
const int N = 2005;
int f[N];
struct Point {
  int x, y;
  bool operator<(const Point &s) const {
    if (x != s.x) return x < s.x;
    return y < s.y;
  }
} p[N];
int main() {
  int h, w, n;
  init();
  scanf("%d%d%d", &h, &w, &n);
  for (int i = 1; i <= n; i++) scanf("%d%d", &p[i].x, &p[i].y);
  sort(p + 1, p + n + 1);
  int ans = C(h + w - 2, h - 1);
  for (int i = 1; i <= n; i++) {
    f[i] = C(p[i].x + p[i].y - 2, p[i].x - 1);
    for (int j = 1; j < i; j++)
      if (p[j].x <= p[i].x && p[j].y <= p[i].y)
        f[i] =
            (f[i] -
             (long long)f[j] *
                 C(p[i].x - p[j].x + p[i].y - p[j].y, p[i].x - p[j].x) % mod +
             mod) %
            mod;
    ans =
        (ans - (long long)f[i] * C(h - p[i].x + w - p[i].y, h - p[i].x) % mod +
         mod) %
        mod;
  }
  ans = (ans % mod + mod) % mod;
  printf("%d\n", ans);
  return 0;
}
