#include <bits/stdc++.h>
using namespace std;
static const long long MOD = 1000000007;
long long FAC[200000];
long long iFAC[200000];
struct Cell {
  int x;
  int y;
  int step;
} c;
long long inv(long long x) {
  long long r = 1, t = x, p = MOD - 2;
  while (p > 0) {
    if (p & 1ll) {
      r *= t;
      r %= MOD;
    }
    t *= t;
    t %= MOD;
    p >>= 1;
  }
  return r;
}
void Init() {
  FAC[0] = 1;
  iFAC[0] = 1;
  for (int i = 1; i < 200000; ++i) {
    FAC[i] = (FAC[i - 1] * (i + 1)) % MOD;
    iFAC[i] = inv(FAC[i]) % MOD;
  }
}
bool CompX(Cell i, Cell j) {
  if (i.x < j.x) return true;
  if (i.x == j.x && i.y < j.y) return true;
  return false;
}
long long Cxy(long long x, long long y) {
  long long a = x + y - 2;
  long long b = x - 1;
  if (a == 0 || b == 0) return 1;
  if (a == b) return 1;
  long long c = (iFAC[b - 1] * iFAC[a - b - 1]) % MOD;
  c = (c * FAC[a - 1]) % MOD;
  return c;
}
int main() {
  int h, w, FAC;
  cin >> h >> w >> FAC;
  vector<Cell> v;
  for (int i = 0; i < FAC; ++i) {
    cin >> c.x;
    cin >> c.y;
    v.push_back(c);
  }
  c.x = h;
  c.y = w;
  v.push_back(c);
  Init();
  sort(v.begin(), v.end(), CompX);
  v[0].step = Cxy(v[0].x, v[0].y);
  for (int i = 1; i < v.size(); ++i) {
    v[i].step = Cxy(v[i].x, v[i].y);
    for (int j = i - 1; j >= 0; --j) {
      if (v[i].y >= v[j].y) {
        v[i].step =
            (v[i].step + MOD -
             (Cxy(v[i].x - v[j].x + 1, v[i].y - v[j].y + 1) * v[j].step) %
                 MOD) %
            MOD;
      }
    }
  }
  cout << v[FAC].step << endl;
}
