#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e3 + 5;
long long exp(long long first, long long second, long long Mod) {
  long long ans = 1, num = first;
  while (second) {
    if (second & 1) ans = ans * num % Mod;
    num = num * num % Mod;
    second = second / 2;
  }
  return ans;
}
long long inv[1000010], fac[1000010];
long long C(long long first, long long second) {
  long long ans = fac[first];
  ans = ans * inv[second] % 1000000007;
  ans = ans * inv[first - second] % 1000000007;
  return ans;
}
long long dp[MAXN];
pair<long long, long long> p[MAXN];
int main() {
  long long m, n, i, j, k, a, b;
  fac[0] = 1;
  inv[0] = 1;
  for (i = 1; i <= 1000000; i++) {
    fac[i] = fac[i - 1] * i % 1000000007;
    inv[i] = exp(fac[i], 1000000007 - 2, 1000000007);
  }
  cin >> a >> b >> m;
  for (i = 0; i < m; i++)
    cin >> p[i].first >> p[i].second, p[i].first--, p[i].second--;
  p[m].first = a - 1, p[m].second = b - 1;
  m++;
  sort(p, p + m);
  for (i = 0; i < m; i++) {
    dp[i] = C(p[i].first + p[i].second, p[i].first);
    for (j = 0; j < i; j++) {
      if (p[j].first <= p[i].first && p[j].second <= p[i].second) {
        dp[i] -= dp[j] *
                 C(p[i].first + p[i].second - (p[j].first + p[j].second),
                   p[i].first - p[j].first) %
                 1000000007;
        dp[i] = (dp[i] + 1000000007) % 1000000007;
      }
    }
  }
  cout << dp[m - 1] << endl;
}
