#include <bits/stdc++.h>
using namespace std;
struct pt {
  long long x, y;
};
bool cmp(pt a, pt b) { return a.x < b.x || (a.x == b.x && a.y < b.y); }
pt a[2002];
long long f[2002], n, m, k, i, j, gt[200001], l[200001];
const long long mod = round(1e9) + 7;
long long lt(long long a, long long b) {
  if (b == 0) return 1;
  long long tg = lt(a, b / 2);
  if (b % 2 == 0) return tg * tg % mod;
  return tg * tg % mod * a % mod;
}
long long tinh(long long n, long long m) {
  return gt[n + m - 2] * l[n - 1] % mod * l[m - 1] % mod;
}
int main() {
  cin >> n >> m >> k;
  for (i = 1; i <= k; i++) cin >> a[i].x >> a[i].y;
  sort(a + 1, a + k + 1, cmp);
  k++;
  a[k] = {n, m};
  gt[0] = 1;
  l[0] = lt(gt[0], mod - 2);
  for (i = 1; i <= 200000; i++) {
    gt[i] = gt[i - 1] * i % mod;
    l[i] = lt(gt[i], mod - 2);
  }
  for (i = 1; i <= k; i++) {
    f[i] = tinh(a[i].x, a[i].y);
    for (j = 1; j < i; j++)
      if (a[j].x <= a[i].x && a[j].y <= a[i].y)
        f[i] = (f[i] -
                f[j] * tinh(a[i].x - a[j].x + 1, a[i].y - a[j].y + 1) % mod +
                mod) %
               mod;
  }
  cout << f[k];
}
