#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
long long fact[200010], inv[200010], fact_inv[200010];
int h, w, n;
pair<int, int> Point[2010];
long long dp[2010];
inline long long Cmb(long long n, long long m) {
  return fact[n] * fact_inv[m] % MOD * fact_inv[n - m] % MOD;
}
int main() {
  int i;
  fact[0] = fact[1] = inv[0] = inv[1] = fact_inv[0] = fact_inv[1] = 1;
  for (i = 2; i <= 200000; ++i) {
    fact[i] = fact[i - 1] * i % MOD;
    inv[i] = (MOD - MOD / i) * inv[MOD % i] % MOD;
    fact_inv[i] = fact_inv[i - 1] * inv[i] % MOD;
  }
  scanf("%d%d%d", &h, &w, &n);
  for (i = 1; i <= n; ++i) {
    scanf("%d%d", &Point[i].first, &Point[i].second);
  }
  Point[n + 1].first = h, Point[n + 1].second = w;
  sort(Point + 1, Point + 1 + n + 1);
  long long tmp;
  int j;
  for (i = 1; i <= n + 1; ++i) {
    tmp = Cmb(Point[i].first + Point[i].second - 2, Point[i].second - 1);
    for (j = 1; j < i; ++j) {
      if (Point[j].first <= Point[i].first &&
          Point[j].second <= Point[i].second) {
        tmp = (tmp -
               dp[j] *
                   Cmb(Point[i].first - Point[j].first + Point[i].second -
                           Point[j].second,
                       Point[i].second - Point[j].second) %
                   MOD +
               MOD) %
              MOD;
      }
    }
    dp[i] = tmp;
  }
  printf("%I64d\n", dp[n + 1]);
}
