#include <bits/stdc++.h>
using namespace std;
const int Mod = 1000000007;
class mint {
 public:
  int first;
  mint(long long second = 0) {
    second %= Mod;
    if (second < 0) second += Mod;
    first = second;
  }
};
mint operator+(mint a, mint b) { return mint(a.first + b.first); }
mint operator-(mint a, mint b) { return mint(a.first - b.first); }
mint operator*(mint a, mint b) { return mint((long long)a.first * b.first); }
void operator+=(mint &a, mint b) { a = a + b; }
void operator*=(mint &a, mint b) { a = a * b; }
mint fact[200006];
mint inv[200006];
mint pow(mint a, int first) {
  mint r = 1;
  while (first) {
    if (first & 1) r *= a;
    a *= a;
    first /= 2;
  }
  return r;
}
mint choose(int a, int b) { return fact[a] * inv[b] * inv[a - b]; }
int h, w, n;
pair<int, int> in[2005];
vector<pair<int, mint> > E[2005];
mint val(int a, int b) {
  return choose(in[b].first + in[b].second - in[a].first - in[a].second,
                in[b].first - in[a].first);
}
int Cnt[2005];
pair<mint, mint> st[2005];
int main() {
  fact[0] = 1;
  for (int i = (int)(0); i < (int)(200005); ++i)
    fact[i + 1] = fact[i] * (i + 1);
  for (int i = (int)(0); i < (int)(200005); ++i) inv[i] = pow(fact[i], Mod - 2);
  scanf("%d%d%d", &h, &w, &n);
  for (int i = (int)(0); i < (int)(n); ++i)
    scanf("%d%d", &in[i].first, &in[i].second);
  in[n++] = {1, 1};
  in[n++] = {h, w};
  for (int i = (int)(0); i < (int)(n); ++i)
    for (int j = (int)(0); j < (int)(n); ++j)
      if (i != j) {
        if (in[i].first > in[j].first || in[i].second > in[j].second) continue;
        E[i].push_back({j, val(i, j)});
      }
  for (int i = (int)(0); i < (int)(n); ++i)
    for (auto first : E[i]) ++Cnt[first.first];
  queue<int> Q;
  Q.push(n - 2);
  st[n - 2] = {1, 0};
  while (!Q.empty()) {
    int id = Q.front();
    Q.pop();
    auto t = st[id];
    swap(t.first, t.second);
    for (auto first : E[id]) {
      st[first.first].first += first.second * t.first;
      st[first.first].second += first.second * t.second;
      if (--Cnt[first.first] == 0) Q.push(first.first);
    }
  }
  printf("%d\n", (st[n - 1].second - st[n - 1].first).first);
  return 0;
}
