#include <bits/stdc++.h>
using namespace std;
int h, w, n;
long long int dp[2050], ji[200050], ni[200050];
struct node {
  int x, y;
  bool operator<(const node &a) const { return x + y < a.x + a.y; }
} point[2050];
long long int power(long long int a, long long int pos) {
  long long int ans = 1;
  while (pos > 0) {
    if (pos & 1) ans = ans * a % 1000000007;
    a = a * a % 1000000007;
    pos >>= 1;
  }
  return ans;
}
void init() {
  ji[0] = ni[0] = ji[1] = ni[1] = 1;
  for (int i = 2; i <= 200000; ++i) {
    ji[i] = ji[i - 1] * i % 1000000007;
    ni[i] = power(ji[i], 1000000007 - 2);
  }
}
long long int C(int a, int b) {
  return ji[a] * ni[b] % 1000000007 * ni[a - b] % 1000000007;
}
int main() {
  init();
  while (~scanf("%d%d%d", &h, &w, &n)) {
    for (int i = 0; i < n; ++i) {
      scanf("%d%d", &point[i].x, &point[i].y);
      --point[i].x, --point[i].y;
    }
    point[n].x = h - 1, point[n].y = w - 1;
    sort(point, point + n + 1);
    int x = point[0].x, y = point[0].y, u, v;
    dp[0] = C(x + y, x);
    for (int i = 1; i <= n; ++i) {
      x = point[i].x, y = point[i].y;
      dp[i] = C(x + y, x);
      for (int j = 0; j < i; ++j) {
        u = point[j].x, v = point[j].y;
        if (v > y || u > x) continue;
        dp[i] =
            (dp[i] - dp[j] * C(x + y - u - v, x - u) % 1000000007) % 1000000007;
        if (dp[i] < 0) dp[i] += 1000000007;
      }
    }
    printf("%I64d\n", dp[n]);
  }
  return 0;
}
