#include <bits/stdc++.h>
using namespace std;
const int mn = 2005, mod = 1e9 + 7;
struct node {
  int x, y;
  bool operator<(const node h) const { return h.x == x ? y < h.y : x < h.x; }
} p[mn];
long long f[mn], frac[200005];
inline long long ksm(long long a, long long b) {
  long long ret = 1, h = a;
  while (b) {
    if (b & 1) (ret *= h) %= mod;
    (h *= h) %= mod, b >>= 1;
  }
  return ret;
}
inline long long C(int a, int b) {
  if (a < b) return 0;
  return frac[a] * ksm(frac[b], mod - 2) % mod * ksm(frac[a - b], mod - 2) %
         mod;
}
int main() {
  int n, m, k;
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= k; i++) scanf("%d%d", &p[i].x, &p[i].y);
  frac[0] = 1;
  for (int i = 1; i <= n + m; i++) frac[i] = 1ll * frac[i - 1] * i % mod;
  p[++k].x = n, p[k].y = m;
  sort(p + 1, p + 1 + k);
  for (int i = 1; i <= k; i++) {
    f[i] = C(p[i].x + p[i].y - 2, p[i].x - 1);
    for (int j = 1; j < i; j++)
      (f[i] -= f[j] * C(p[i].x - p[j].x + p[i].y - p[j].y, p[i].x - p[j].x) %
               mod) %= mod,
          f[i] = (f[i] + mod) % mod;
  }
  printf("%I64d\n", f[k]);
}
