#include <bits/stdc++.h>
using namespace std;
const int N = (int)4e6 + 10;
const int mod = (int)1e9 + 7;
struct point {
  int x, y;
  point() {}
  point(int x, int y) : x(x), y(y) {}
  bool operator<(const point p) const { return (y == p.y ? x < p.x : y < p.y); }
};
point p[N];
int n, m, cnt, sz;
int fact[N], rfact[N], f[N];
int power(int a, int n) {
  if (n == 0) return 1;
  if (n & 1)
    return 1LL * a * power(a, n - 1) % mod;
  else {
    int x = power(a, n / 2);
    return 1LL * x * x % mod;
  }
}
int comb(int n, int k) {
  return (1LL * (1LL * fact[n] * rfact[n - k]) % mod * rfact[k]) % mod;
}
int main() {
  cin >> n >> m >> cnt;
  for (; sz < cnt; ++sz) cin >> p[sz].x >> p[sz].y;
  p[sz++] = point(n, m);
  sort(p, p + sz);
  fact[0] = 1;
  for (int i = 1; i <= n + m; ++i) fact[i] = (1LL * fact[i - 1] * i) % mod;
  for (int i = 0; i <= n + m; ++i) rfact[i] = power(fact[i], mod - 2);
  for (int i = 0; i < sz; ++i) {
    f[i] = comb(p[i].x + p[i].y - 2, p[i].x - 1);
    for (int j = 0; j < i; ++j) {
      f[i] -= (1LL * f[j] *
               comb(p[i].x + p[i].y - p[j].x - p[j].y, p[i].x - p[j].x)) %
              mod;
      f[i] = (f[i] + mod) % mod;
    }
  }
  cout << f[sz - 1] << endl;
  return 0;
}
