#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const long double PI = (long double)(3.1415926535897932384626433832795);
inline bool ispow2(int x) { return (x != 0 && (x & (x - 1)) == 0); }
int msb(unsigned x) {
  union {
    double a;
    int b[2];
  };
  a = x;
  return (b[1] >> 20) - 1023;
}
template <class T>
inline void cinarr(T a, int n) {
  for (int i = 0; i < n; ++i) cin >> a[i];
}
int fastMax(int x, int y) { return (((y - x) >> (32 - 1)) & (x ^ y)) ^ y; }
int fastMin(int x, int y) { return (((y - x) >> (32 - 1)) & (x ^ y)) ^ x; }
inline long long gcd(long long a, long long b) {
  long long t;
  while (b) {
    a = a % b;
    t = a;
    a = b;
    b = t;
  }
  return a;
}
inline long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
const int mx = 3e5 + 7;
vector<pair<int, int> > A;
long long inv_fact[mx], fact[mx];
long long dp[mx];
long long powmod(long long int a, int b) {
  if (b == 0) return 1;
  if (b == 1) return a;
  long long int ans = powmod(a, b / 2);
  ans = (ans * ans) % mod;
  if (b % 2) ans = (ans * a) % mod;
  return ans;
}
long long from_to(int x1, int y1, int x2, int y2) {
  long long a = inv_fact[(x2 - x1)] % mod;
  long long b = inv_fact[(y2 - y1)] % mod;
  long long ans = fact[(x2 - x1 + y2 - y1)] % mod;
  ans = (ans * 1ll * a) % mod;
  ans = (ans * 1ll * b) % mod;
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  fact[0] = 1;
  inv_fact[0] = 1;
  for (int i = 1; i < mx; i++) {
    fact[i] = (fact[i - 1] * i) % mod;
    inv_fact[i] = powmod(fact[i], mod - 2);
  }
  long long n, h, w;
  cin >> h >> w >> n;
  A.resize(n + 1);
  for (int i = 0; i < n; i++) {
    cin >> A[i].first >> A[i].second;
  }
  A[n] = make_pair(h, w);
  sort(A.begin(), A.end());
  for (int i = 0; i < A.size(); i++) {
    dp[i] = from_to(1, 1, A[i].first, A[i].second);
  }
  for (int i = 0; i < A.size(); i++) {
    for (int j = 0; j < i; j++) {
      long long sub =
          (dp[j] * from_to(A[j].first, A[j].second, A[i].first, A[i].second)) %
          mod;
      if (A[i].second >= A[j].second) {
        dp[i] = (dp[i] + mod - sub) % mod;
      }
    }
  }
  cout << dp[n] << "\n";
  return 0;
}
