#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
int h, w, n;
long long ex[200010];
vector<pair<int, int> > p;
class cmp {
 public:
  bool operator()(const pair<int, int>& a, const pair<int, int>& b) {
    return a.first + a.second < b.first + b.second;
  }
};
long long dp[2010];
long long mpow(long long a, long long r) {
  if (r == 0) return 1;
  if (r == 1) return a % MOD;
  long long ans = mpow(a, r / 2);
  ans = ans * ans % MOD;
  if (r & 1) (ans *= a) %= MOD;
  return ans;
}
long long inv(long long a) { return mpow(a, MOD - 2); }
long long nck(long long a, long long b) {
  return ex[a] * inv(ex[b] * ex[a - b] % MOD) % MOD;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> h >> w >> n;
  for (int i = 0; i < (n); i++) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    p.push_back(make_pair(x, y));
  }
  p.push_back(make_pair(h - 1, w - 1));
  sort(p.begin(), p.end(), cmp());
  ex[0] = 1;
  for (int i = 0; i < (200010 - 1); i++) ex[i + 1] = ex[i] * (i + 1) % MOD;
  for (int i = 0; i < (n + 1); i++) {
    dp[i] = nck(p[i].first + p[i].second, p[i].first);
    for (int j = 0; j < (i); j++) {
      long long cc = dp[j];
      if (p[i].first - p[j].first < 0 || p[i].second - p[j].second < 0)
        continue;
      cc *= nck(p[i].first + p[i].second - p[j].first - p[j].second,
                p[i].first - p[j].first);
      cc %= MOD;
      dp[i] += MOD - cc;
      dp[i] %= MOD;
    }
  }
  cout << dp[n] << endl;
}
