#include <bits/stdc++.h>
using namespace std;
void smain();
int main() {
  ios_base::sync_with_stdio(0);
  smain();
  return 0;
}
long long h, w;
struct pt {
  long long first, second;
  bool operator<(const pt& b) const {
    return first == b.first ? second < b.second : first < b.first;
  }
};
pt a[2002];
long long f[200010], rf[200010];
inline long long powmod(long long A, long long n) {
  long long r = 1;
  for (; n; n >>= 1, A = A * A % 1000000007)
    if (n & 1) r = r * A % 1000000007;
  return r;
}
inline long long C(long long n, long long k) {
  return f[n] * (rf[k] * rf[n - k] % 1000000007) % 1000000007;
}
long long d[2002][2002];
inline long long solve(long long n) {
  a[n++] = pt{0, 0};
  a[n++] = pt{h - 1, w - 1};
  sort(a, a + n);
  vector<vector<long long> > pre(n, vector<long long>());
  for (long long i = 0; i < n; i++)
    for (long long j = 0; j < i; j++)
      if (a[j].first <= a[i].first && a[j].second <= a[i].second)
        pre[i].push_back(j);
  for (long long i = 0; i < 1; i++) {
    d[i][i] = 1;
    for (long long j = i + 1; j < n; ++j) {
      if (a[j].second < a[i].second) continue;
      long long dx = a[j].first - a[i].first, dy = a[j].second - a[i].second;
      d[i][j] = C(dx + dy, dx);
      for (auto it = lower_bound(pre[j].begin(), pre[j].end(), i + 1);
           it != pre[j].end(); ++it) {
        long long k = *it;
        if (a[k].second < a[i].second) continue;
        long long x = d[i][k];
        if (x) {
          dx = a[j].first - a[k].first, dy = a[j].second - a[k].second;
          d[i][j] -= x * C(dx + dy, dx) % 1000000007;
          if (d[i][j] < 0) d[i][j] += 1000000007;
        }
      }
    }
  }
  return d[0][n - 1];
}
void smain() {
  long long n;
  f[0] = 1;
  for (long long i = 0; i < 200010 - 1; i++)
    f[i + 1] = f[i] * (i + 1) % 1000000007;
  for (long long i = 0; i < 200010; i++) rf[i] = powmod(f[i], 1000000007 - 2);
  for (; cin >> h >> w >> n;) {
    for (long long i = 0; i < n; i++) cin >> a[i].first >> a[i].second;
    for (long long i = 0; i < n; i++) a[i].first -= 1, a[i].second -= 1;
    cout << solve(n) << '\n';
  }
}
