#include <bits/stdc++.h>
using namespace std;
struct Point {
  int x, y;
  bool operator<(const Point &a) const {
    return x < a.x || x == a.x && y < a.y;
  }
} a[200010];
const long long mod = 1e9 + 7;
long long nn[200010], dp[2010];
int h, w, n;
long long Pow(long long x, long long n) {
  long long ans = 1;
  while (n) {
    if (n & 1) ans = (ans * x) % mod;
    x = x * x % mod;
    n >>= 1;
  }
  return ans;
}
long long C(int n, int m) {
  if (n < m) return 0;
  long long ans = nn[m] * nn[n - m] % mod;
  ans = nn[n] * Pow(ans, mod - 2) % mod;
  return ans;
}
int main() {
  scanf("%d%d%d", &h, &w, &n);
  nn[0] = 1;
  for (int i = 1; i < h + w; ++i) nn[i] = nn[i - 1] * i % mod;
  for (int i = 1; i <= n; ++i) scanf("%d%d", &a[i].x, &a[i].y);
  long long ans = C(h + w - 2, h - 1);
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; ++i) {
    dp[i] = C(a[i].x + a[i].y - 2, a[i].x - 1);
    for (int j = 1; j < i; ++j)
      if (a[i].y >= a[j].y)
        dp[i] = (dp[i] -
                 dp[j] * C(a[i].x - a[j].x + a[i].y - a[j].y, a[i].x - a[j].x) %
                     mod +
                 mod) %
                mod;
    ans = (ans - dp[i] * C(h - a[i].x + w - a[i].y, h - a[i].x) % mod + mod) %
          mod;
  }
  printf("%I64d\n", ans);
  return 0;
}
