#include <bits/stdc++.h>
using namespace std;
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& p) {
  os << "[ ";
  for (T x : p) os << x << " ";
  os << "]" << endl;
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const set<T>& p) {
  os << "{ ";
  for (T x : p) os << x << " ";
  os << "}" << endl;
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const multiset<T>& p) {
  os << "{ ";
  for (T x : p) os << x << " ";
  os << "}" << endl;
  return os;
}
template <typename Tk, typename Tv>
ostream& operator<<(ostream& os, const map<Tk, Tv>& p) {
  os << "{ ";
  for (pair<Tk, Tv> x : p) os << x << " ";
  os << "}" << endl;
  return os;
}
template <typename Tk, typename Tv>
ostream& operator<<(ostream& os, const pair<Tk, Tv>& p) {
  os << "{" << p.first << ',' << p.second << "}";
  return os;
}
long long gcd(long long a, long long b) { return (a ? gcd(b % a, a) : b); }
long long power(long long a, long long n) {
  long long p = 1;
  while (n > 0) {
    if (n & 1) {
      p = p * a;
    }
    n >>= 1;
    a *= a;
  }
  return p;
}
long long power(long long a, long long n, long long mod) {
  long long p = 1;
  while (n > 0) {
    if (n & 1) {
      p = p * a;
      p %= mod;
    }
    n >>= 1;
    a *= a;
    a %= mod;
  }
  return p % mod;
}
const int N = 200005;
vector<pair<int, int> > v;
long long dp[2005], fact[N], inv[N];
long long f(int x, int y, int z, int w) {
  if (z - x < 0 || w - y < 0) return 0;
  long long num = fact[z - x + w - y];
  num = ((num * inv[z - x]) % 1000000007 * inv[w - y]) % 1000000007;
  return num;
}
int main() {
  int i, j;
  fact[0] = inv[0] = 1;
  for (i = 1; i < N; i++) {
    fact[i] = (fact[i - 1] * i) % 1000000007;
    inv[i] = power(fact[i], 1000000007 - 2, 1000000007);
  }
  int n, m, q;
  scanf("%d", &n), scanf("%d", &m), scanf("%d", &q);
  while (q--) {
    scanf("%d", &i), scanf("%d", &j);
    v.push_back({i, j});
  }
  sort(v.begin(), v.end());
  for (i = 0; i < v.size(); i++) {
    dp[i] = f(1, 1, v[i].first, v[i].second);
    for (j = 0; j < i; j++)
      dp[i] = (dp[i] -
               (dp[j] * f(v[j].first, v[j].second, v[i].first, v[i].second)) %
                   1000000007 +
               1000000007) %
              1000000007;
  }
  long long ans = f(1, 1, n, m);
  for (i = 0; i < v.size(); i++)
    ans = (ans - (dp[i] * f(v[i].first, v[i].second, n, m)) % 1000000007 +
           1000000007) %
          1000000007;
  printf("%lld\n", (long long)ans);
  return 0;
}
