#include <bits/stdc++.h>
using namespace std;
template <class T>
ostream& operator<<(ostream& cout, vector<T> V) {
  cout << "[ ";
  for (auto v : V) cout << v << ' ';
  return cout << ']';
}
template <class L, class R>
ostream& operator<<(ostream& cout, pair<L, R> P) {
  return cout << '(' << P.first << ',' << P.second << ')';
}
long long int modpow(long long int a, long long int n,
                     long long int m = 1000000007) {
  long long int ans = 1;
  while (n) {
    if (n % 2) ans = ((long long)ans * a) % m;
    a = ((long long)a * a) % m;
    n /= 2;
  }
  return ans;
}
long long int inv(long long int a, long long int m = 1000000007) {
  return modpow(a, m - 2, m);
}
long long int fact[200005 + 1], ifact[200005 + 1];
void ini_fact() {
  fact[0] = ifact[0] = 1;
  for (long long int i = 1; i <= 200005; i++) {
    fact[i] = ((long long)fact[i - 1] * i) % 1000000007;
    ifact[i] = inv(fact[i]);
  }
}
long long int c(long long int n, long long int r) {
  return ((((long long)fact[n] * ifact[r]) % 1000000007) *
          (long long)ifact[n - r]) %
         1000000007;
}
long long int n, m, b;
vector<pair<long long int, long long int>> a;
vector<long long int> ans;
long long int f(long long int x1, long long int y1, long long int x2 = n - 1,
                long long int y2 = m - 1) {
  if (x1 > x2 || y1 > y2) return 0;
  x2 -= x1;
  y2 -= y1;
  return c(x2 + y2, x2);
}
long long int calc(long long int ind) {
  if (ans[ind] != -1) return ans[ind];
  ans[ind] = f(a[ind].first, a[ind].second);
  for (long long int i = 0; i < b; i++) {
    if (i == ind) continue;
    ans[ind] -=
        f(a[ind].first, a[ind].second, a[i].first, a[i].second) * ans[i];
    ans[ind] %= 1000000007;
  }
  return ans[ind];
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ini_fact();
  cin >> n >> m >> b;
  a.resize(b);
  for (long long int i = 0; i < (b); i++) {
    cin >> a[i].first >> a[i].second;
    a[i].first--;
    a[i].second--;
  }
  sort(a.begin(), a.end());
  ans.resize(b, -1);
  for (long long int i = b - 1; i >= 0; i--) calc(i);
  long long int fans = 0;
  for (long long int i = 0; i < (b); i++) {
    ans[i] *= f(0, 0, a[i].first, a[i].second);
    ans[i] %= 1000000007;
    fans += ans[i];
  }
  fans %= 1000000007;
  long long int ffans = f(0, 0);
  ffans -= fans;
  ffans %= 1000000007;
  if (ffans < 0) ffans += 1000000007;
  cout << ffans << '\n';
  cerr << "Time : " << 1000 * (long double)clock() / (long double)CLOCKS_PER_SEC
       << "ms\n";
  ;
}
