#include <bits/stdc++.h>
using namespace std;
double EPS = 1e-9;
int INF = (int)1e9;
long long INFF = 8000000000000000000LL;
double PI = acos(-1);
int dirx[8] = {-1, 0, 0, 1, -1, -1, 1, 1};
int diry[8] = {0, 1, -1, 0, -1, 1, -1, 1};
pair<int, int> coordinates[2020];
long long factorial[200005], invmod[200005];
const int mod = 1000000007;
int sol[2020];
long long f(long long a, int b) {
  if (b == 0) return 1LL;
  if (b & 1) return (a * f(a, b - 1)) % mod;
  long long x = f(a, b / 2);
  return (x * x) % mod;
}
void precal() {
  factorial[0] = 1;
  invmod[0] = 1;
  for (int i = 1; i < 200005; i++) {
    factorial[i] = (i * factorial[i - 1]) % mod;
    invmod[i] = f(factorial[i], mod - 2);
  }
}
long long C(int x, int y) {
  return (((factorial[x] * invmod[y]) % mod) * invmod[x - y]) % mod;
}
int main() {
  precal();
  int h, w, n;
  scanf("%d%d%d", &h, &w, &n);
  for (int i = 0; i < n; i++)
    scanf("%d%d", &coordinates[i].first, &coordinates[i].second);
  sort(coordinates, coordinates + n);
  coordinates[n] = make_pair(h, w);
  int x, y;
  for (int i = 0; i <= n; i++) {
    x = coordinates[i].first;
    y = coordinates[i].second;
    sol[i] = C(x + y - 2, x - 1);
    for (int j = 0; j < i; j++)
      if (coordinates[j].first <= x && coordinates[j].second <= y) {
        sol[i] =
            (sol[i] + mod -
             (sol[j] * C(x - coordinates[j].first + y - coordinates[j].second,
                         x - coordinates[j].first)) %
                 mod) %
            mod;
      }
  }
  printf("%d\n", sol[n]);
  return 0;
}
