#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  char ch = getchar();
  long long x = 0, f = 1;
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch <= '9' && ch >= '0') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
long long p = 1e9 + 7;
long long fc[2020202];
struct node {
  long long x, y;
} t[4040404];
bool cmp(node a, node b) {
  if (a.x != b.x)
    return a.x < b.x;
  else
    return a.y < b.y;
}
long long ksm(long long a, long long b, long long p) {
  long long ans = 1;
  while (b) {
    if (b & 1) {
      ans = (ans * a) % p;
    }
    b >>= 1;
    a = (a * a) % p;
  }
  return ans;
}
long long c(int n, int m) {
  return fc[n] * ksm(fc[m], p - 2, p) % p * ksm(fc[n - m], p - 2, p) % p;
}
long long f[202002];
int main() {
  int h = read(), w = read(), n = read();
  for (int i = 1; i <= n; i++) {
    t[i].x = read(), t[i].y = read();
  }
  fc[0] = 1;
  for (int i = 1; i <= 200000; i++) {
    fc[i] = fc[i - 1] * i % p;
  }
  sort(t + 1, t + n + 1, cmp);
  t[0].x = 0, t[0].y = 0;
  t[n + 1].x = h, t[n + 1].y = w;
  for (int i = 1; i <= n + 1; i++) {
    f[i] = c(t[i].x + t[i].y - 2, t[i].x - 1);
    for (int j = 1; j < i; j++) {
      if (t[j].x > t[i].x || t[j].y > t[i].y) continue;
      f[i] -=
          (f[j] * c(t[i].x + t[i].y - t[j].x - t[j].y, t[i].x - t[j].x) % p);
      f[i] %= p;
    }
  }
  cout << (f[n + 1] + p) % p;
  return 0;
}
