#include <bits/stdc++.h>
using namespace std;
long long n, m, w;
pair<long long, long long> a[400005];
long long gt[400005], d[400005];
long long mu(long long x, long long y) {
  if (y == 0) return 1;
  long long g = mu(x, y / 2);
  if (y % 2)
    return (((g * g) % 1000000007) * x) % 1000000007;
  else
    return (g * g) % 1000000007;
}
long long C(long long x, long long y) {
  if (x == 0 || y == 0 || x == y) return 1;
  if (y == 1) return 1;
  long long res = gt[y];
  long long pp = (gt[x] * gt[y - x]) % 1000000007;
  return (res * mu(pp, 1000000007 - 2)) % 1000000007;
}
int main() {
  cin >> n >> m >> w;
  for (int i = 1; i <= w; i++) cin >> a[i].first >> a[i].second;
  a[++w] = make_pair(n, m);
  sort(a + 1, a + w + 1);
  gt[1] = 1;
  for (long long i = 2; i <= 300000; i++) gt[i] = (gt[i - 1] * i) % 1000000007;
  long long ans = C(n - 1, n + m - 2);
  for (int i = 1; i <= w; i++) {
    d[i] = C(a[i].first - 1, a[i].second + a[i].first - 2);
    for (int j = 1; j < i; j++) {
      if (a[j].second > a[i].second) continue;
      int u = a[i].second - a[j].second + 1;
      int v = a[i].first - a[j].first + 1;
      d[i] -= (d[j] * C(u - 1, u + v - 2)) % 1000000007;
      d[i] = (d[i] + 1000000007) % 1000000007;
    }
  }
  cout << d[w];
}
