#include <bits/stdc++.h>
using namespace std;
long long binpow(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = (res * a) % 1000000007;
    a = (a * a) % 1000000007;
    b >>= 1;
  }
  return res;
}
long long f[8000000], inv[8000000];
long long get(int x, int y, int x2, int y2) {
  int n = x2 - x;
  int m = y2 - y;
  long long res = f[n + m];
  res = (res * inv[n]) % 1000000007;
  res = (res * inv[m]) % 1000000007;
  return res;
}
int n, m, k;
struct node {
  int x, y;
  bool operator<(node T) const {
    if (x == T.x) return y < T.y;
    return x < T.x;
  }
} a[8000000];
long long d[8000000];
void solve() {
  cin >> n >> m >> k;
  for (int i = 1; i <= k; ++i) {
    cin >> a[i].x >> a[i].y;
  }
  ++k;
  a[k].x = n, a[k].y = m;
  sort(a + 1, a + 1 + k);
  memset(d, 0, sizeof d);
  for (int i = 1; i <= k; ++i) {
    d[i] = get(1, 1, a[i].x, a[i].y);
    for (int j = 1; j < i; ++j) {
      if (a[i].x >= a[j].x && a[i].y >= a[j].y) {
        d[i] = (d[i] - get(a[j].x, a[j].y, a[i].x, a[i].y) * d[j]) % 1000000007;
        if (d[i] < 0) d[i] += 1000000007;
      }
    }
  }
  cout << d[k] << '\n';
}
int main() {
  f[0] = 1;
  inv[0] = 1;
  for (int i = 1; i <= 200000; ++i) {
    f[i] = (f[i - 1] * i) % 1000000007;
    inv[i] = binpow(f[i], 1000000007 - 2);
  }
  solve();
  return 0;
}
