#include <bits/stdc++.h>
using namespace std;
const long long p = 1000000007LL;
struct block {
  int r, c;
  int way;
  block(const int &_r = 0, const int &_c = 0) : r(_r), c(_c), way(0) {}
};
block black[2004];
bool myCmp(const block &a, const block &b) {
  return a.r < b.r || (a.r == b.r && a.c < b.c);
}
int quickMe(const int &a, const int &n) {
  if (n == 0) return 1;
  int tmp = quickMe(a, n / 2);
  if (n & 1) return 1LL * tmp * tmp % p * a % p;
  return 1LL * tmp * tmp % p;
}
int c(int n, int m) {
  static long long F[200004], iF[200004];
  if (F[0] == 0) {
    F[0] = F[1] = 1;
    for (int i = 2; i < 200004; ++i) F[i] = F[i - 1] * i % p;
    iF[0] = iF[1] = 1;
    for (int i = 2; i < 200004; ++i) iF[i] = quickMe(F[i], p - 2);
  }
  return F[n] * iF[n - m] % p * iF[m] % p;
}
int main() {
  c(0, 0);
  int h, w, n;
  scanf(" %d%d%d", &h, &w, &n);
  for (int i = 0; i < n; ++i) {
    scanf(" %d%d", &black[i].r, &black[i].c);
  }
  sort(&black[0], &black[n], myCmp);
  black[n].r = h;
  black[n].c = w;
  int nowId = 0;
  while (black[nowId].r == 1) {
    if (nowId == 0)
      black[nowId].way = 1;
    else
      black[nowId].way = 0;
    ++nowId;
  }
  while (nowId <= n) {
    block &now = black[nowId];
    now.way = c(now.r + now.c - 2, now.r - 1);
    for (int i = 0; i < nowId; ++i) {
      if (black[i].c > now.c) continue;
      int rdif = now.r - black[i].r;
      int cdif = now.c - black[i].c;
      int thatWay = 1LL * black[i].way * c(rdif + cdif, rdif) % p;
      now.way = (0LL + now.way - thatWay + p) % p;
    }
    ++nowId;
  }
  printf("%d\n", black[n].way);
}
