#include <bits/stdc++.h>
using namespace std;
const int N = 2e3 + 20, H = 2e5 + 20, MOD = (int)(1e9) + 7;
int h, w, n, f[H], i, j, dp[N], pw[H];
pair<int, int> p[N];
int mul(int a, int b) { return (1ll * a * b) % MOD; }
int power(int a, int b) {
  int num = a, ans = 1;
  while (b) {
    if (b & 1) ans = mul(ans, num);
    b >>= 1;
    num = mul(num, num);
  }
  return ans;
}
int InverseEuler(int n, int MOD) { return power(n, MOD - 2); }
int C(int n, int r, int MOD) { return mul(f[n], mul(pw[r], pw[n - r])); }
int paths(int x, int y) { return y < 0 ? 0 : C(x + y, x, MOD); }
int main() {
  f[0] = 1, pw[0] = InverseEuler(f[0], MOD);
  for (i = 1; i < H; i++) {
    f[i] = (1LL * f[i - 1] * i) % MOD;
    pw[i] = InverseEuler(f[i], MOD);
  }
  scanf("%d%d%d", &h, &w, &n);
  for (i = 0; i < n; i++) scanf("%d%d", &p[i].first, &p[i].second);
  p[n++] = {h, w};
  sort(p, p + n);
  for (i = 0; i < n; i++) {
    dp[i] = paths(p[i].first - 1, p[i].second - 1);
    for (j = 0; j < i; j++) {
      h = mul(paths(p[i].first - p[j].first, p[i].second - p[j].second), dp[j]);
      dp[i] = (dp[i] - h + MOD) % MOD;
    }
  }
  printf("%d", dp[n - 1]);
}
