#include <bits/stdc++.h>
using namespace std;
const int Mod = 1e9 + 7;
const int N = 2e3 + 11;
const int M = 2e5 + 11;
struct Node {
  int x, y;
  friend bool operator<(const Node& a, const Node& b) {
    return a.x == b.x ? a.y < b.y : a.x < b.x;
  }
};
Node arr[N];
long long dp[N];
long long inv[M];
long long fac[M];
long long rfc[M];
void init() {
  inv[0] = inv[1] = 1;
  fac[0] = fac[1] = 1;
  rfc[0] = rfc[1] = 1;
  for (int i = 2; i < M; ++i) {
    inv[i] = ((Mod - Mod / i) * inv[Mod % i]) % Mod;
    fac[i] = (fac[i - 1] * i) % Mod;
    rfc[i] = (rfc[i - 1] * inv[i]) % Mod;
  }
}
long long calc(long long k, long long n) {
  return (fac[n] * rfc[k] % Mod) * rfc[n - k] % Mod;
}
int main() {
  init();
  int h, w, n;
  scanf("%d %d %d", &h, &w, &n);
  for (int i = 0; i < n; ++i) scanf("%d %d", &arr[i].x, &arr[i].y);
  arr[n].x = h, arr[n].y = w;
  ++n;
  sort(arr, arr + n);
  for (int i = 0; i < n; ++i) {
    dp[i] = calc(arr[i].x - 1, arr[i].x + arr[i].y - 2);
    for (int j = 0; j < i; ++j) {
      if (arr[j].y <= arr[i].y) {
        dp[i] -= (calc(arr[i].x - arr[j].x,
                       arr[i].x - arr[j].x + arr[i].y - arr[j].y) *
                  dp[j]) %
                 Mod;
        if (dp[i] < 0) dp[i] += Mod;
      }
    }
    dp[i] %= Mod;
  }
  printf("%lld\n", (dp[n - 1] + Mod) % Mod);
}
