#include <bits/stdc++.h>
using namespace std;
struct Point {
  int x, y;
};
bool comp(Point P, Point Q) {
  if (P.x != Q.x)
    return P.x < Q.x;
  else
    return P.y < Q.y;
}
const int N = 2000 + 5;
const int T = 2e5 + 5;
const int MOD = 1e9 + 7;
int power(int a, int n) {
  if (n == 0) return 1;
  int p = power(a, n / 2);
  p = ((long long)p * p) % MOD;
  if (n % 2) p = ((long long)p * a) % MOD;
  return p;
}
int ft[T], ift[T];
inline int ncr(int n, int r) {
  static int ans;
  ans = ((long long)ft[n] * ift[r]) % MOD;
  ans = ((long long)ans * ift[n - r]) % MOD;
  return ans;
}
Point ob[N];
int DP[N];
inline int nw(int i, int j) {
  static int a, b;
  a = ob[j].x - ob[i].x;
  b = ob[j].y - ob[i].y;
  return ncr(a + b, a);
}
int main() {
  ft[0] = 1;
  for (int i = 1; i < T; i++) {
    ft[i] = ((long long)i * ft[i - 1]) % MOD;
  }
  ift[T - 1] = power(ft[T - 1], MOD - 2);
  for (int i = T - 2; i >= 0; i--) {
    ift[i] = ((long long)(i + 1) * ift[i + 1]) % MOD;
  }
  int h, w, n;
  scanf("%d %d %d", &h, &w, &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d %d", &ob[i].x, &ob[i].y);
  }
  sort(ob + 1, ob + n + 1, comp);
  ob[0].x = ob[0].y = 1;
  ob[n + 1].x = h, ob[n + 1].y = w;
  for (int i = 1; i <= n + 1; i++) {
    DP[i] = nw(0, i);
    for (int j = 1; j < i; j++) {
      if (ob[j].y <= ob[i].y) {
        DP[i] -= ((long long)DP[j] * nw(j, i)) % MOD;
        DP[i] %= MOD;
      }
    }
  }
  DP[n + 1] = (DP[n + 1] + MOD) % MOD;
  printf("%d\n", DP[n + 1]);
  return 0;
}
