#include <bits/stdc++.h>
using namespace std;
class Node {
 public:
  Node(int a = 1, int b = 1) : x(a), y(b) {}
  int x, y;
};
long long factor[(200000 + 5)] = {0};
long long wayl[(2000 + 5)];
long long wayr[(2000 + 5)];
Node node[(2000 + 5)];
bool cmp(Node lhs, Node rhs) { return (lhs.x + lhs.y) < (rhs.x + rhs.y); }
long long f(int a) {
  if (a == 0) return 1;
  if (factor[a] != 0) return factor[a];
  return factor[a] = f(a - 1) * a % (1000000000 + 7);
}
long long inverse(long long mod, long long b) {
  long long k[2][2], n[2][2], u1, u2;
  k[0][0] = k[1][1] = 1;
  k[0][1] = k[1][0] = 0;
  u1 = mod, u2 = b;
  while (u2) {
    long long div = u1 / u2;
    long long remind = u1 % u2;
    n[0][0] = k[1][0];
    n[0][1] = k[1][1];
    n[1][0] = k[0][0] - k[1][0] * div;
    n[1][1] = k[0][1] - k[1][1] * div;
    for (int i = 0; i < 2; ++i) {
      for (int j = 0; j < 2; ++j) {
        k[i][j] = n[i][j];
      }
    }
    u1 = u2;
    u2 = remind;
  }
  if (k[0][1] < 0) k[0][1] += mod;
  return k[0][1];
}
inline long long wayInClear(int a, int b) {
  return f(node[b].x - node[a].x + node[b].y - node[a].y) *
         inverse((long long)(1000000000 + 7), factor[node[b].x - node[a].x]) %
         (1000000000 + 7) *
         inverse((long long)(1000000000 + 7), factor[node[b].y - node[a].y]) %
         (1000000000 + 7);
}
void solve2() {
  int h, w, n;
  scanf("%d%d%d", &h, &w, &n);
  node[n + 1] = Node(h, w);
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &node[i].x, &node[i].y);
  }
  sort(node, node + n + 2, cmp);
  for (int i = 0; i <= n + 1; i++) {
    wayl[i] = f(node[i].x - 1 + node[i].y - 1) *
              inverse((long long)(1000000000 + 7), factor[node[i].x - 1]) %
              (1000000000 + 7) *
              inverse((long long)(1000000000 + 7), factor[node[i].y - 1]) %
              (1000000000 + 7);
    wayr[i] = f(h - node[i].x + w - node[i].y) *
              inverse((long long)(1000000000 + 7), factor[h - node[i].x]) %
              (1000000000 + 7) *
              inverse((long long)(1000000000 + 7), factor[w - node[i].y]) %
              (1000000000 + 7);
  }
  for (int join = 1; join <= n; join++) {
    for (int i = join + 1; i <= n + 1; i++) {
      if (node[join].x <= node[i].x && node[join].y <= node[i].y) {
        wayl[i] -= wayl[join] * wayInClear(join, i) % (1000000000 + 7);
        wayl[i] = (wayl[i] + (1000000000 + 7)) % (1000000000 + 7);
      }
    }
  }
  printf("%I64d", wayl[n + 1]);
}
void preprocess() {
  factor[0] = 1;
  for (int i = 1; i < (200000 + 5); i++) {
    factor[i] = factor[i - 1] * i % (1000000000 + 7);
  }
}
int main() {
  preprocess();
  solve2();
  return 0;
}
