#include <bits/stdc++.h>
using namespace std;
struct chess {
  int x, y;
} a[2005];
int fac[200005], inv[200005], f[2005];
inline bool cmp(chess _, chess __) {
  return (_.x == __.x ? _.y < __.y : _.x < __.x);
}
int ksm(int x, int y) {
  return (!y ? 1
             : 1LL * ksm(1LL * x * x % 1000000007, y >> 1) * (y & 1 ? x : 1) %
                   1000000007);
}
int C(int x, int y) {
  return 1LL * fac[x] * inv[y] % 1000000007 * inv[x - y] % 1000000007;
}
int main() {
  int n, h, w, i, j, k;
  cin >> h >> w >> n;
  for (i = 1; i <= (n); i++) cin >> a[i].x >> a[i].y;
  fac[0] = 1;
  for (i = 1; i <= (h + w); i++) fac[i] = 1LL * fac[i - 1] * i % 1000000007;
  inv[h + w] = ksm(fac[h + w], 1000000007 - 2);
  for (i = h + w - 1; i >= (0); i--)
    inv[i] = 1LL * inv[i + 1] * (i + 1) % 1000000007;
  a[++n].x = h;
  a[n].y = w;
  sort(a + 1, a + n + 1, cmp);
  for (i = 1; i <= (n); i++) {
    f[i] = C(a[i].x + a[i].y - 2, a[i].x - 1);
    for (j = 0; j <= (i - 1); j++)
      if (a[i].y >= a[j].y)
        f[i] =
            (f[i] - 1LL * f[j] *
                        C(a[i].x - a[j].x + a[i].y - a[j].y, a[i].x - a[j].x)) %
            1000000007;
  }
  cout << (f[n] + 1000000007) % 1000000007;
  return 0;
}
