#include <bits/stdc++.h>
using namespace std;
struct P {
  int x, y;
  P() {}
  P(int _x, int _y) {
    x = _x;
    y = _y;
  }
  bool operator<(P b) const { return x != b.x ? x < b.x : y < b.y; }
} p[2005];
long long pmod(long long a, long long n) {
  long long res = 1;
  a %= 1000000007LL;
  while (n != 0) {
    if (n & 1) {
      res *= a;
      res %= 1000000007LL;
    }
    n >>= 1;
    a *= a;
    a %= 1000000007LL;
  }
  return res;
}
long long fac[200005], inv[200005], dpa[2005];
int h, w, n;
long long getinv(long long a) { return pmod(a, 1000000007LL - 2); }
long long combo(int x, int y) {
  return fac[x] * inv[y] % 1000000007LL * inv[x - y] % 1000000007LL;
}
int main() {
  ios::sync_with_stdio(false);
  fac[0] = inv[0] = 1;
  for (int i = 1; i < 200005; i++) {
    fac[i] = fac[i - 1] * i % 1000000007LL;
    inv[i] = getinv(fac[i]);
  }
  int x, y;
  cin >> h >> w >> n;
  for (int i = 1; i <= n; i++) cin >> p[i].x >> p[i].y;
  p[++n] = P(h, w);
  sort(p + 1, p + n + 1);
  for (int i = 1; i <= n; i++) {
    x = p[i].x;
    y = p[i].y;
    dpa[i] = combo(x + y - 2, x - 1);
    for (int j = 1; j < i; j++)
      if (p[j].x <= p[i].x && p[j].y <= p[i].y) {
        x = p[i].x - p[j].x + 1;
        y = p[i].y - p[j].y + 1;
        long long t = dpa[j] * combo(x + y - 2, x - 1) % 1000000007LL;
        dpa[i] = (dpa[i] - t + 1000000007LL) % 1000000007LL;
      }
  }
  cout << dpa[n];
  return 0;
}
