#include <bits/stdc++.h>
using namespace std;
int mod = 1e9 + 7;
pair<int, int> a[2010];
int N, M, n;
int mul(int a, int b) { return 1ll * a * b % mod; }
int norm(int a) {
  a = a % mod;
  return a < 0 ? a + mod : a;
}
int gt[200010], igt[200010];
int fpow(int a, int b) {
  if (b == 0) return 1;
  int t = fpow(a, b / 2);
  t = mul(t, t);
  if (b % 2) return mul(t, a);
  return t;
}
void init() {
  int maxm = 200000;
  gt[0] = 1;
  for (int i = 1; i <= maxm; ++i) gt[i] = mul(gt[i - 1], i);
  igt[maxm] = fpow(gt[maxm], mod - 2);
  for (int i = maxm - 1; i >= 0; --i) igt[i] = mul(igt[i + 1], i + 1);
}
int comb(int k, int n) {
  if (k > n) return 0;
  return mul(mul(gt[n], igt[k]), igt[n - k]);
}
bool cmp(pair<int, int> L, pair<int, int> R) {
  return L.first == R.first ? L.second < R.second : L.first < R.first;
}
int f[2010];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> N >> M >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i].first >> a[i].second;
  }
  a[n + 1] = {N, M};
  sort(a + 1, a + n + 1, cmp);
  init();
  for (int i = 1; i <= n + 1; ++i) {
    f[i] = comb(a[i].first - 1, a[i].first + a[i].second - 2);
    for (int j = 1; j < i; ++j) {
      f[i] = norm(f[i] - mul(f[j], comb(a[i].first - a[j].first,
                                        a[i].first + a[i].second - a[j].first -
                                            a[j].second)));
    }
  }
  cout << f[n + 1];
  return 0;
}
