#include <bits/stdc++.h>
using namespace std;
struct po {
  int x, y;
  po(int a, int b) : x(a), y(b) {}
  po() {}
  bool operator<(const po &a) const {
    return ((x < a.x) || (x == a.x && y < a.y));
  }
};
inline int read() {
  char ch = getchar();
  int x = 0, f = 1;
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    x = (x << 3) + (x << 1) + ch - '0', ch = getchar();
  return x * f;
}
po poi[2000 + 10];
int dp[2000 + 10];
int n, m, v;
int fac[(100000 + 10) << 1], ni1[(100000 + 10) << 1], ni2[(100000 + 10) << 1];
inline void init() {
  for (int i = 1; i <= v; i++) {
    int x = read(), y = read();
    poi[i] = po(x, y);
  }
  poi[v + 1] = po(n, m);
  ni1[1] = 1;
  for (int i = 2; i <= n + m; i++)
    ni1[i] =
        1ll * (1000000007 - 1000000007 / i) * ni1[1000000007 % i] % 1000000007;
  ni2[0] = fac[1] = ni2[1] = 1;
  for (int i = 2; i <= n + m; i++) {
    fac[i] = 1ll * fac[i - 1] * i % 1000000007;
    ni2[i] = 1ll * ni2[i - 1] * ni1[i] % 1000000007;
  }
  return;
}
inline void work() {
  for (int i = 1; i <= v + 1; i++) {
    dp[i] = (1ll * fac[(poi[i].x + poi[i].y - 2)] * ni2[(poi[i].x - 1)] %
             1000000007 * ni2[(poi[i].x + poi[i].y - 2) - (poi[i].x - 1)] %
             1000000007);
    for (int j = 1; j < i; j++)
      if (poi[j].y <= poi[i].y)
        dp[i] = (1ll * dp[i] -
                 1ll * dp[j] *
                     (1ll * fac[(poi[i].x - poi[j].x + poi[i].y - poi[j].y)] *
                      ni2[(poi[i].x - poi[j].x)] % 1000000007 *
                      ni2[(poi[i].x - poi[j].x + poi[i].y - poi[j].y) -
                          (poi[i].x - poi[j].x)] %
                      1000000007) %
                     1000000007 +
                 1000000007) %
                1000000007;
  }
  return;
}
int main() {
  n = read(), m = read(), v = read();
  init();
  sort(poi + 1, poi + v + 1);
  work();
  printf("%d\n", dp[v + 1]);
  return 0;
}
