#include <bits/stdc++.h>
using namespace std;
long long fact[200010];
long long invfact[200010];
long long dp[3000];
long long inv(long long x, long long p);
int main() {
  fact[0] = 1;
  for (int i = 1; i <= 200010; i++) {
    fact[i] = (1ll * fact[i - 1] * i) % 1000000007;
  }
  invfact[200005] = inv(fact[200005], 1000000007 - 2);
  for (int i = 200004; i >= 0; i--) {
    invfact[i] = (1ll * invfact[i + 1] * (i + 1)) % 1000000007;
  }
  int h, w, n;
  int a, b;
  cin >> h >> w >> n;
  vector<pair<int, int>> v;
  for (int i = 0; i < n; i++) {
    cin >> a >> b;
    if (a == b && b == 1) {
      cout << 0;
      return 0;
    }
    v.push_back({a - 1, b - 1});
  }
  sort(v.begin(), v.end());
  v.push_back({h - 1, w - 1});
  for (int i = 0; i < v.size(); i++) {
    dp[i] = (((((1ll * fact[v[i].first + v[i].second]) % 1000000007) * 1ll *
               invfact[v[i].first]) %
              1000000007) *
             1ll * invfact[v[i].second]) %
            1000000007;
    for (int j = 0; j < i; j++) {
      if (v[j].second > v[i].second) continue;
      dp[i] -= (((((1ll * dp[j] *
                    fact[v[i].first + v[i].second - v[j].first - v[j].second]) %
                   1000000007) *
                  1ll * invfact[v[i].first - v[j].first]) %
                 1000000007) *
                1ll * invfact[v[i].second - v[j].second]) %
               1000000007;
      while (dp[i] < 0) dp[i] += 1000000007;
    }
  }
  cout << dp[n];
}
long long inv(long long x, long long p) {
  if (p == 0) return 1;
  long long a = inv(x, p / 2);
  a = 1ll * (a * a) % 1000000007;
  if (p & 1) a = 1ll * (a * x) % 1000000007;
  return a;
}
