#include <bits/stdc++.h>
using namespace std;
int R, C, n;
pair<int, int> A[2010];
const int MOD = int(1e9) + 7;
const int N = int(4e5) + 10;
long long int fact[N], invfact[N];
long long int power(long long int a, long long int p, long long int mod) {
  long long int ret = 1;
  while (p) {
    if (p & 1) ret = (ret * a) % mod;
    a = (a * a) % mod;
    p /= 2;
  }
  return ret;
}
long long int add(long long int l, long long int r) {
  l = (l + r) % MOD;
  return l;
}
long long int sub(long long int l, long long int r) {
  l = (l - r);
  if (l < 0) l += MOD;
  return l;
}
long long int mult(long long int l, long long int r) {
  l = (l * r) % MOD;
  return l;
}
long long int nCr(int n, int r) {
  return (((fact[n] * invfact[r]) % MOD) * invfact[n - r]) % MOD;
}
long long int numWays(pair<int, int> one, pair<int, int> two) {
  int r1 = one.first;
  int c1 = one.second;
  int r2 = two.first;
  int c2 = two.second;
  if (r2 < r1) return 0;
  if (c2 < c1) return 0;
  int u = r2 - r1;
  int r = c2 - c1;
  return nCr(u + r, min(u, r));
}
void preprocess() {
  fact[0] = 1;
  for (int i = 1; i < N; i++) fact[i] = (fact[i - 1] * i) % MOD;
  invfact[0] = 1;
  for (int i = 1; i < N; i++) invfact[i] = power(fact[i], MOD - 2, MOD);
}
long long int dist[2010];
int main() {
  preprocess();
  scanf("%d", &R);
  scanf("%d", &C);
  scanf("%d", &n);
  A[0].first = A[0].second = 1;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &A[i].first);
    scanf("%d", &A[i].second);
  }
  A[n + 1].first = R;
  A[n + 1].second = C;
  n += 2;
  sort(A, A + n);
  pair<int, int> start = A[0], end = A[n - 1];
  long long int total = numWays(start, end);
  long long int minus = 0;
  for (int i = 1; i < n - 1; i++) {
    pair<int, int> p = A[i];
    long long int num = numWays(start, p);
    for (int j = i - 1; j > 0; j--)
      num = sub(num, mult(dist[j], numWays(A[j], p)));
    dist[i] = num;
    minus = add(minus, mult(num, numWays(p, end)));
  }
  total = sub(total, minus);
  printf("%lld\n", total);
  return 0;
}
