#include <bits/stdc++.h>
using namespace std;
const int mxn = 200005;
const int mod = 1e9 + 7;
int n, m, T, ans;
int dp[2005];
int fac[mxn], inv[mxn];
struct point {
  int x, y;
} p[2005];
inline bool comp(point u, point v) {
  return u.x == v.x ? u.y < v.y : u.x < v.x;
}
inline void init() {
  int i, j;
  fac[0] = inv[0] = inv[1] = 1;
  for (i = 1; i <= 200000; i++) fac[i] = (long long)fac[i - 1] * i % mod;
  for (i = 2; i <= 200000; i++)
    inv[i] = (long long)(mod - mod / i) * inv[mod % i] % mod;
  for (i = 1; i <= 200000; i++) inv[i] = (long long)inv[i] * inv[i - 1] % mod;
}
inline long long C(int n, int m) {
  if (n < m) return 0;
  return (long long)fac[n] * inv[m] % mod * inv[n - m] % mod;
}
int main() {
  int i, j;
  init();
  scanf("%d%d%d", &n, &m, &T);
  for (i = 1; i <= T; i++) scanf("%d%d", &p[i].x, &p[i].y);
  ++T, p[T].x = n, p[T].y = m;
  for (i = 1; i <= T; i++) p[i].x--, p[i].y--;
  sort(p + 1, p + T + 1, comp);
  for (i = 1; i <= T; i++) {
    dp[i] = C(p[i].x + p[i].y, p[i].y);
    for (j = 1; j <= i - 1; j++)
      dp[i] = (dp[i] - C(p[i].x - p[j].x + p[i].y - p[j].y, p[i].x - p[j].x) *
                           dp[j] % mod) %
              mod;
  }
  printf("%d\n", (dp[T] + mod) % mod);
  return 0;
}
