#include <bits/stdc++.h>
using namespace std;
const int P = 1000000007;
int h, w, n, f[2005];
long long jc[200005], inv[200005];
struct node {
  int x, y;
} p[2005];
int C(int n, int m) { return jc[n] * inv[m] % P * inv[n - m] % P; }
long long mypow(long long a, int b) {
  long long c = 1;
  while (b) {
    if (b & 1) c = c * a % P;
    a = a * a % P;
    b >>= 1;
  }
  return c;
}
bool cmp(node a, node b) {
  if (a.x == b.x) return a.y < b.y;
  return a.x < b.x;
}
int main() {
  jc[0] = 1;
  inv[0] = 1;
  for (int i = 1; i <= 200000; i++) {
    jc[i] = jc[i - 1] * i % P;
    inv[i] = mypow(jc[i], P - 2);
  }
  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 + 1 + n, cmp);
  p[n + 1].x = h, p[n + 1].y = w;
  for (int i = 1; i <= n + 1; i++) {
    f[i] = C(p[i].x + p[i].y - 2, p[i].x - 1);
    for (int j = 1; j <= i - 1; j++) {
      if (p[j].x > p[i].x || p[j].y > p[i].y) continue;
      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)) %
             P;
    }
  }
  cout << (f[n + 1] + P) % P;
  return 0;
}
