#include <bits/stdc++.h>
using namespace std;
int h, w, n;
long long inv[200005];
long long fact[200005];
long long dp[200005];
struct node {
  int x, y;
} a[200005];
bool cmp(node a, node b) {
  if (a.x != b.x)
    return a.x < b.x;
  else
    return a.y < b.y;
}
long long C(int x, int y) {
  return fact[x] % 1000000007 * inv[y] % 1000000007 * inv[x - y] % 1000000007;
}
int main() {
  cin >> h >> w >> n;
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &a[i].x, &a[i].y);
  }
  a[n + 1].x = h;
  a[n + 1].y = w;
  sort(a + 1, a + 1 + n, cmp);
  inv[1] = 1;
  inv[0] = 1;
  fact[1] = 1;
  for (int i = 2; i <= 200005; i++) {
    fact[i] = fact[i - 1] % 1000000007 * i % 1000000007;
    inv[i] = (1000000007 - 1000000007 / i) * inv[1000000007 % i] % 1000000007;
  }
  for (int i = 2; i <= 200005; i++) {
    inv[i] = inv[i] % 1000000007 * inv[i - 1] % 1000000007;
  }
  for (int i = 1; i <= n + 1; i++) {
    int xi = a[i].x, yi = a[i].y;
    dp[i] = C(xi + yi - 2, xi - 1);
    for (int j = 1; j < i; j++) {
      int xj = a[j].x, yj = a[j].y;
      if (xi < xj || yi < yj) continue;
      dp[i] = (dp[i] - dp[j] * C(xi - xj + yi - yj, xi - xj)) % 1000000007;
    }
    dp[i] = (dp[i] % 1000000007 + 1000000007) % 1000000007;
  }
  cout << dp[n + 1];
}
