#include <bits/stdc++.h>
using namespace std;
const int MAXH = 200000 + 10, MAXN = 2000 + 10;
const long long MOD = 1000000007;
struct Point {
  int x, y;
  bool operator<(const Point &p1) const { return x + y < p1.x + p1.y; }
} p[MAXN];
long long fac[MAXH], inv[MAXH];
long long f[MAXN];
inline long long Fastpow(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) (res *= a) %= MOD;
    (a *= a) %= MOD;
    b >>= 1;
  }
  return res;
}
long long Calc(int a, int b) {
  return ((((fac[a + b - 2] * inv[a - 1]) % MOD) * inv[b - 1]) % MOD);
}
int main() {
  int h, w, n, mx;
  scanf("%d%d%d", &h, &w, &n);
  mx = h + w;
  for (int i = 1; i <= n; ++i) scanf("%d%d", &p[i].x, &p[i].y);
  p[++n] = (Point){h, w};
  sort(p + 1, p + 1 + n);
  fac[0] = inv[0] = 1;
  for (int i = 1; i <= mx; ++i) fac[i] = fac[i - 1] * (long long)i % MOD;
  for (int i = 1; i <= mx; ++i) inv[i] = Fastpow(fac[i], MOD - 2);
  for (int i = 1; i <= n; ++i) {
    f[i] = Calc(p[i].x, p[i].y);
    for (int j = 1; j < i; ++j)
      if (p[j].x <= p[i].x && p[j].y <= p[i].y) {
        f[i] -= f[j] * Calc(p[i].x - p[j].x + 1, p[i].y - p[j].y + 1) % MOD;
        ((f[i] %= MOD) += MOD) %= MOD;
      }
  }
  cout << f[n] << endl;
  return 0;
}
