#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:20000000")
using namespace std;
int ri() {
  int x;
  scanf("%d", &x);
  return x;
}
long long rll() {
  long long x;
  scanf("%lld", &x);
  return x;
}
long long fact[200500];
long long rev[200500];
long long MOD = 1e9 + 7;
long long bin_s(long long x, long long step) {
  long long res = 1;
  while (step) {
    if (step & 1) res *= x, res %= MOD;
    x *= x;
    x %= MOD;
    step >>= 1;
  }
  return res;
}
pair<int, int> mas[2050];
int dp[2050];
void add(int &x, int v) {
  x += v;
  if (x >= MOD) x -= MOD;
}
int getValue(int i, int j) {
  int nx = mas[j].first;
  int ny = mas[j].second;
  int x = mas[i].first;
  int y = mas[i].second;
  int len = nx - x + ny - y;
  long long temp = fact[len];
  temp *= rev[nx - x];
  temp %= MOD;
  temp *= rev[len - (nx - x)];
  temp %= MOD;
  return (int)temp;
}
void solve() {
  int n = ri(), m = ri(), cnt = ri();
  fact[0] = rev[0] = 1;
  for (int i = (int)(1); i <= (int)(n + m); i++) {
    fact[i] = (fact[i - 1] * (long long)i) % MOD;
    rev[i] = bin_s(fact[i], MOD - 2);
  }
  for (int i = (int)(0); i <= (int)(cnt - 1); i++)
    mas[i].first = ri(), mas[i].second = ri();
  mas[cnt] = make_pair(n, m);
  mas[cnt + 1] = make_pair(1, 1);
  sort(mas, mas + 1 + cnt);
  for (int i = (int)(0); i <= (int)(cnt); i++) {
    dp[i] = getValue(cnt + 1, i);
    for (int j = (int)(0); j <= (int)(i - 1); j++) {
      if (mas[j].second > mas[i].second) continue;
      long long a = dp[j];
      long long b = getValue(j, i);
      long long c = (a * b) % MOD;
      dp[i] -= c;
      if (dp[i] < 0) dp[i] += MOD;
    }
  }
  cout << dp[cnt] << endl;
}
int main() {
  solve();
  return 0;
}
