#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
const int mod = 1e9 + 7;
const int N = 1e5 + 10;
struct point {
  int x, y;
} p[2010];
bool cmp(point p1, point p2) {
  return p1.x < p2.x || (p1.x == p2.x && p1.y < p2.y);
}
int H, W, n;
long long dp[2010], ny[200010], jc[200010];
long long qpow(long long x, int times) {
  long long ret = 1;
  while (times) {
    if (times & 1) ret = ret * x % mod;
    times >>= 1;
    x = x * x % mod;
  }
  return ret;
}
long long C(long long n, int m) {
  if (n < m) return 1;
  return (jc[n] * ny[m] % mod * ny[n - m] % mod);
}
int main() {
  jc[0] = 1;
  ny[0] = 1;
  for (int i = 1; i <= 200009; i++) {
    jc[i] = jc[i - 1] * i % mod;
    ny[i] = qpow(jc[i], mod - 2) % mod;
  }
  H = read();
  W = read();
  n = read();
  for (int i = 1; i <= n; i++) p[i].x = read(), p[i].y = read();
  p[0].x = p[0].y = 1;
  p[n + 1].x = H, p[n + 1].y = W;
  sort(p, p + n + 2, cmp);
  dp[0] = 1ll;
  for (int i = 1; i <= n + 1; i++) {
    dp[i] = C(p[i].x - p[0].x + p[i].y - p[0].y, p[i].x - p[0].x) % mod;
    for (int j = 1; j <= i - 1; j++)
      if (p[j].y <= p[i].y)
        dp[i] = (dp[i] -
                 dp[j] * C(p[i].x - p[j].x + p[i].y - p[j].y, p[i].x - p[j].x) %
                     mod +
                 mod) %
                mod;
  }
  cout << dp[n + 1];
  return 0;
}
