#include <bits/stdc++.h>
using namespace std;
struct Point {
  long long x, y;
  friend istream &operator>>(istream &_, Point &a) {
    scanf("%I64d%I64d", &a.x, &a.y);
    a.x--, a.y--;
    return _;
  }
  friend bool operator<(Point a, Point b) {
    if (a.x == b.x) return a.y < b.y;
    return a.x < b.x;
  }
} pt[3100];
long long quick_my(long long x, long long y) {
  long long ret = 1;
  while (y) {
    if (y & 1) ret = ret * x % 1000000007;
    x = x * x % 1000000007;
    y >>= 1;
  }
  return ret;
}
long long fac[200100], inv_fac[200100], f[3100];
int n, m, p;
void init() {
  fac[0] = 1, inv_fac[0] = 1;
  for (long long i = 1; i <= 200000; i++) {
    fac[i] = fac[i - 1] * i % 1000000007;
    inv_fac[i] = quick_my(fac[i], 1000000007 - 2);
  }
}
long long get_C(long long x, long long y) {
  return (fac[x] * inv_fac[y] % 1000000007) * inv_fac[x - y] % 1000000007;
}
int main() {
  init();
  scanf("%d%d", &n, &m);
  n--, m--;
  scanf("%d", &p);
  for (int i = 1; i <= p; i++) cin >> pt[i];
  pt[++p].x = n, pt[p].y = m;
  sort(pt + 1, pt + p + 1);
  for (int i = 1; i <= p; i++) {
    f[i] = get_C(pt[i].x + pt[i].y, pt[i].x);
    for (int j = 1; j < i; j++) {
      if (pt[j].y <= pt[i].y)
        f[i] = ((f[i] - f[j] *
                            get_C(pt[i].x - pt[j].x + pt[i].y - pt[j].y,
                                  pt[i].x - pt[j].x) %
                            1000000007) %
                    1000000007 +
                1000000007) %
               1000000007;
    }
  }
  printf("%I64d\n", f[p]);
}
