#include <bits/stdc++.h>
using namespace std;
long long f[2000007], inv[2000007];
pair<long long, long long> box[2000007];
long long dp[2000007];
int t;
bool count_kora_jaabe(pair<long long, long long> a,
                      pair<long long, long long> b) {
  if (a.first <= b.first and a.second <= b.second) return 1;
  return 0;
}
long long Pow(long long x, long long y) {
  long long res = 1;
  while (y > 0) {
    if (y & 1) res = (res * x) % 1000000007;
    x = (x * x) % 1000000007;
    y >>= 1;
  }
  return res;
}
bool cmp(pair<long long, long long> a, pair<long long, long long> b) {
  if (a.first == b.first) return a.second < b.second;
  return a.first < b.first;
}
void init() {
  f[0] = f[1] = inv[0] = inv[1] = 1;
  for (long long i = 2; i < 2000007; i++)
    f[i] = (f[i - 1] * i) % 1000000007, inv[i] = Pow(f[i], 1000000007 - 2);
}
long long number_of_ways(pair<long long, long long> x,
                         pair<long long, long long> y) {
  long long tot = f[abs(x.first + x.second - y.first - y.second)];
  long long nich = inv[y.first - x.first];
  nich = (nich * inv[y.second - x.second]) % 1000000007;
  return (tot * nich) % 1000000007;
}
long long ways(pair<long long, long long> p, int id) {
  long long tot = number_of_ways(pair<long long, long long>(1, 1), p);
  for (int i = 0; i < id; i++)
    if (count_kora_jaabe(box[i], p))
      tot = (tot - (dp[i] * number_of_ways(box[i], box[id])) % 1000000007 +
             1000000007) %
            1000000007;
  return tot;
}
int main() {
  init();
  int n, m;
  cin >> n >> m >> t;
  for (int i = 0; i < t; i++) cin >> box[i].first >> box[i].second;
  box[t] = pair<long long, long long>(n, m);
  sort(box, box + t + 1, cmp);
  for (int i = 0; i <= t; i++) dp[i] = ways(box[i], i);
  cout << dp[t] << endl;
}
