#include <bits/stdc++.h>
using namespace std;
const int N = 3000;
int n, m;
int h, w;
pair<int, int> mas[N];
long long fac[300000], rfac[300000];
long long mod = 1e9 + 7;
inline long long BiPow(long long base, int deg) {
  long long res = 1;
  while (deg) {
    if (deg & 1) res = (res * base) % mod;
    base = (base * base) % mod;
    deg >>= 1;
  }
  return res;
}
long long ans[N];
inline int mul(int x, int y) { return (x * (long long)y) % mod; }
inline int c(int x, int y) { return mul(mul(fac[y], rfac[x]), rfac[y - x]); }
void solve() {
  cin >> h >> w >> n;
  fac[0] = 1;
  rfac[0] = 1;
  for (int i = 1; i <= h + w; ++i) {
    fac[i] = mul(fac[i - 1], i);
    rfac[i] = BiPow(fac[i], mod - 2);
  }
  for (int i = 0; i < n; ++i) {
    cin >> mas[i].first >> mas[i].second;
  }
  sort(mas, mas + n);
  mas[n++] = pair<int, int>(h, w);
  for (int i = 0; i < n; ++i) {
    ans[i] = c(mas[i].first - 1, mas[i].first + mas[i].second - 2);
  }
  for (int i = 0; i < n; ++i) {
    for (int j = i + 1; j < n; ++j) {
      if (mas[j].first < mas[i].first || mas[j].second < mas[i].second)
        continue;
      int x = mas[j].first - mas[i].first, y = mas[j].second - mas[i].second;
      ans[j] -= mul(ans[i], c(x, x + y));
      ans[j] = (ans[j] + mod) % mod;
    }
  }
  cout << ans[n - 1];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  solve();
}
