#include <bits/stdc++.h>
using namespace std;
const int N = 223456;
const int mod = (int)1e9 + 7;
int bin(int x, int y) {
  int ans = 1;
  while (y) {
    if (y & 1) {
      ans = ans * 1ll * x % mod;
    }
    x = x * 1ll * x % mod;
    y >>= 1;
  }
  return ans;
}
int n, m, k;
int f[N], rf[N], dp[N];
vector<pair<int, int> > v;
int cnk(int nn, int kk) {
  return (f[nn] * 1ll * rf[kk] % mod) * 1ll * rf[nn - kk] % mod;
}
int get(int x, int y) { return cnk(x + y - 2, y - 1); }
int main() {
  scanf("%d %d %d", &n, &m, &k);
  f[0] = 1;
  for (int i = 1; i <= n + m; ++i) {
    f[i] = f[i - 1] * 1ll * i % mod;
  }
  rf[n + m] = bin(f[n + m], mod - 2);
  for (int i = n + m - 1; i >= 0; --i) {
    rf[i] = rf[i + 1] * 1ll * (i + 1) % mod;
  }
  for (int i = 1; i <= k; ++i) {
    int x, y;
    scanf("%d %d", &x, &y);
    v.push_back({x, y});
  }
  sort(v.begin(), v.end());
  v.push_back(make_pair(n, m));
  for (int i = 0; i < (int)v.size(); ++i) {
    dp[i] = get(v[i].first, v[i].second);
    for (int j = 0; j < i; ++j) {
      if (v[j].first > v[i].first || v[j].second > v[i].second) continue;
      int ways =
          get(v[i].first - v[j].first + 1, v[i].second - v[j].second + 1) *
          1ll * dp[j] % mod;
      dp[i] = (dp[i] - ways + mod) % mod;
    }
  }
  printf("%d", dp[(int)v.size() - 1]);
  return 0;
}
