#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline T sqr(T x) {
  T x_ = (x);
  return x_ * x_;
}
template <typename T>
inline T qbr(T x) {
  T x_ = (x);
  return x_ * x_ * x_;
}
template <typename T>
inline int sign(T x) {
  T x_ = (x);
  return ((x_ > T(0)) - (x_ < T(0)));
}
template <typename T>
inline T mod(T x, T m) {
  T x_ = (x);
  return (((x_) >= 0) ? ((x_) % (m)) : ((((x_) % (m)) + (m)) % (m)));
}
template <typename T>
inline T gcd(T a, T b) {
  while (b) {
    b ^= a ^= b ^= a %= b;
  }
  return a;
}
template <typename T>
inline T gcd_ex(T a, T b, T& x, T& y) {
  if (b == 0) {
    x = 1, y = 0;
    return a;
  }
  T x1, y1;
  T d = gcd_ex(b, a % b, x1, y1);
  x = y1;
  y = x1 - (a / b) * y1;
  return d;
}
template <typename T>
inline T lcm(T a, T b) {
  return (a * (b / gcd(a, b)));
}
template <typename T>
inline T binpow(T x, T deg) {
  T res = (T)1;
  for (; deg; x *= x, deg >>= 1)
    if (deg & 1) res *= x;
  return res;
}
template <typename T>
inline T modpow(T x, T deg, T m) {
  assert(deg >= (T)0);
  T res = (T)(1);
  for (; deg; x = (((x) % m) * ((x) % m)) % m, deg >>= 1)
    if (deg & 1) res = (((res) % m) * ((x) % m)) % m;
  return res;
}
template <typename T>
inline bool is_between(T POSITION, T LEFT, T RIGHT) {
  return (LEFT < POSITION) && (POSITION < RIGHT);
}
template <typename T>
inline bool is_inside(T POSITION, T LEFT, T RIGHT) {
  return (LEFT <= POSITION) && (POSITION <= RIGHT);
}
template <typename Collection, typename UnaryOperation>
void foreach (Collection& col, UnaryOperation op) {
  for_each(begin(col), end(col), op);
}
template <typename Collection, typename UnaryOperation>
Collection fmap(Collection& col, UnaryOperation op) {
  transform(begin(col), end(col), col.begin(), op);
  return col;
}
template <typename Collection, typename binop>
Collection zip(Collection& fc, Collection& sc, binop op) {
  transform(begin(fc), end(fc), sc.begin(), fc.begin(), op);
  return fc;
}
template <typename Collection, typename Condition>
bool exists(Collection& col, Condition con) {
  auto exist = find_if(begin(col), end(col), con);
  return exist != col.end();
}
template <typename Collection, typename Predicate>
Collection filterNot(Collection& col, Predicate predicate) {
  auto returnIterator = remove_if(begin(col), end(col), predicate);
  col.erase(returnIterator, end(col));
  return col;
}
template <typename Collection, typename Predicate>
Collection filter(Collection& col, Predicate predicate) {
  auto fnCol = filterNot(col, [predicate](typename Collection::value_type i) {
    return !predicate(i);
  });
  return fnCol;
}
template <class T, template <class, class...> class Collection>
T sum(const Collection<T>& Col) {
  return accumulate(begin(Col), end(Col), T{}, plus<T>());
}
template <class T, template <class, class...> class Collection>
T product(const Collection<T>& Col) {
  return accumulate(begin(Col), end(Col), T{1}, multiplies<T>());
}
const long long MAX = 2e5 + 1, M = 1e9 + 7;
long long n, h, w;
long long f[MAX], d[2001], inv[MAX];
pair<long long, long long> b[2001];
long long inverse(long long n) {
  long long x, y;
  gcd_ex(n, M, x, y);
  return mod(x, M);
}
long long C(long long n, long long r) {
  return (n < r || n < 0 || r < 0) ? 0 : f[n] * inv[r] % M * inv[n - r] % M;
}
long long Cat(long long x, long long y) {
  return (x < 0 || y < 0) ? 0 : C(x + y, x);
}
void init() {
  f[0] = 1, inv[0] = 1;
  for (int i = 1; i < MAX; i++) {
    f[i] = (f[i - 1] * i) % M;
    inv[i] = (inv[i - 1] * inverse(i)) % M;
  }
}
int main() {
  init();
  scanf("%lld %lld %lld", &h, &w, &n);
  for (int i = 0; i < n; i++) scanf("%lld %lld", &b[i].first, &b[i].second);
  b[n++] = {h, w};
  sort(b, b + n);
  for (int i = 0; i < n; i++) {
    long long yi = b[i].first, xi = b[i].second;
    long long to_substract = 0;
    for (int j = 0; j < i; j++) {
      long long yj = b[j].first, xj = b[j].second;
      to_substract += (d[j] * Cat(yi - yj, xi - xj)) % M, to_substract %= M;
    }
    d[i] = mod(C(xi + yi - 2, yi - 1) - to_substract, M);
  }
  printf("%lld\n", d[n - 1]);
  return !true && !false;
}
