#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000 * 1000 * 1000 + 7;
vector<long long> fact(210000), inv_fact(210000);
struct node {
  int x, y;
};
bool cmp(node a, node b) {
  if (a.x < b.x) {
    return true;
  } else if (a.x == b.x && a.y < b.y) {
    return true;
  }
  return false;
}
long long bin_pow(long long a, long long pow) {
  long long res = 1;
  while (pow != 0) {
    if (pow % 2) {
      res = (res * a) % MOD;
      pow--;
    } else {
      a = (a * a) % MOD;
      pow /= 2;
    }
  }
  if (res < 0) {
    res += MOD;
  }
  return res;
}
long long C(long long n, long long k) {
  long long ans = ((fact[n] * inv_fact[n - k]) % MOD) * inv_fact[k] % MOD;
  if (ans < 0) {
    ans += MOD;
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int h, w, n;
  cin >> h >> w >> n;
  vector<node> v(n + 1);
  for (int i = 0; i < n; i++) {
    cin >> v[i].x >> v[i].y;
  }
  v[n].x = h;
  v[n].y = w;
  sort(v.begin(), v.end(), cmp);
  fact[0] = 1;
  inv_fact[0] = 1;
  for (int i = 1; i <= 201000; i++) {
    fact[i] = (long long)fact[i - 1] * i % MOD;
    if (fact[i] < 0) {
      fact[i] += MOD;
    }
  }
  for (int i = 1; i <= 201000; i++) {
    inv_fact[i] = bin_pow(fact[i], MOD - 2);
  }
  vector<long long> dp(n + 100, 0);
  for (int i = 0; i <= n; i++) {
    dp[i] = (long long)C(v[i].x + v[i].y - 2, v[i].x - 1) % MOD;
    if (dp[i] < 0) {
      dp[i] += MOD;
    }
    for (int j = 0; j < i; j++) {
      if (v[j].x <= v[i].x && v[j].y <= v[i].y) {
        dp[i] -= (long long)dp[j] *
                 C(v[i].x + v[i].y - v[j].x - v[j].y, v[i].x - v[j].x) % MOD;
        if (dp[i] < 0) {
          dp[i] += MOD;
        }
      }
    }
  }
  cout << dp[n] << endl;
}
