#include <bits/stdc++.h>
using namespace std;
template <typename C>
void MA(C& a, C b) {
  if (a < b) a = b;
}
template <typename C>
void MI(C& a, C b) {
  if (a > b) a = b;
}
int h, w;
int n;
long long sil[300000], odw[300000];
const int P = 1e9 + 7;
struct lam {
  int a, b;
  int wyn;
} l[3011];
int il;
pair<int, int> t[3011];
long long dwu(int a, int b) { return sil[a + b] * odw[a] % P * odw[b] % P; }
int licz(int x, int y) {
  long long res = 0;
  for (int i = 0; i < il; i++) {
    if (x >= l[i].a && y >= l[i].b)
      res += dwu(x - l[i].a, y - l[i].b) * l[i].wyn % P;
  }
  return res % P;
}
long long pot(long long a, int w) {
  long long res = 1;
  while (w) {
    if (w & 1) {
      res *= a;
      res %= P;
    }
    w /= 2;
    a *= a;
    a %= P;
  }
  return res;
}
int main() {
  sil[0] = 1;
  for (int i = 1; i < 300000; i++) sil[i] = sil[i - 1] * i % P;
  for (int i = 0; i < 300000; i++) odw[i] = pot(sil[i], P - 2);
  scanf("%d%d", &h, &w);
  scanf("%d", &n);
  l[0] = {1, 1, 1};
  il = 1;
  for (int i = 0; i < n; i++) scanf("%d%d", &t[i].first, &t[i].second);
  sort(t, t + n);
  for (int i = 0; i < n; i++) {
    int wyn = licz(t[i].first, t[i].second);
    l[il++] = {t[i].first, t[i].second, -wyn};
  }
  printf("%d\n", (licz(h, w) + P) % P);
}
