#include <bits/stdc++.h>
const double PI = acos(-1.0);
using namespace std;
int setb(int n, int pos) { return n = n | (1 << pos); }
int resb(int n, int pos) { return n = n & ~(1 << pos); }
bool checkb(int n, int pos) { return (bool)(n & (1 << pos)); }
inline long long bigmod(long long b, long long p, long long m) {
  long long ret = 1, cur = b % m;
  while (p) {
    if (p & 1) ret = (ret * cur) % m;
    cur = (cur * cur) % m;
    p = p >> 1;
  }
  return ret;
}
struct info {
  long long x, y;
};
info ara[2005];
long long n;
long long fact[1000005];
long long nCr(long long x, long long y) {
  long long lob = fact[x];
  long long hor = (fact[y] * fact[x - y]) % 1000000007;
  return (lob * bigmod(hor, 1000000007 - 2, 1000000007)) % 1000000007;
}
inline bool cango(info a, info b) { return (a.x <= b.x && a.y <= b.y); }
stack<long long> st;
bool visit[2005];
void dfs(long long u) {
  visit[u] = 1;
  long long v;
  for (v = 1; v <= n; v++) {
    if (visit[v] == 0 && cango(ara[u], ara[v])) dfs(v);
  }
  st.push(u);
}
void prework() {
  long long i;
  fact[0] = 1;
  for (i = 1; i <= 1000000; i++) fact[i] = (fact[i - 1] * i) % 1000000007;
  for (i = 1; i <= n; i++)
    if (visit[i] == 0) dfs(i);
}
long long way[2005];
long long solve() {
  while (st.empty() == 0) {
    long long u = st.top();
    st.pop();
    if (u == 1) continue;
    long long i, ret = nCr(ara[u].x + ara[u].y - 2, ara[u].x - 1);
    for (i = 1; i <= n; i++) {
      if (i == u || cango(ara[i], ara[u]) == 0) continue;
      long long frst = way[i];
      long long dx = ara[u].x - ara[i].x;
      long long dy = ara[u].y - ara[i].y;
      long long second = nCr(dx + dy, dx);
      ret = (ret - frst * second) % 1000000007;
    }
    ret = (ret + 1000000007) % 1000000007;
    way[u] = ret;
  }
  return way[n];
}
int main() {
  long long x, y;
  scanf("%lld %lld", &x, &y);
  scanf("%lld", &n);
  ara[n + 2].x = x;
  ara[n + 2].y = y;
  ara[1].x = ara[1].y = 1;
  for (int i = 2; i <= n + 1; i++) {
    scanf("%lld %lld", &x, &y);
    ara[i].x = x;
    ara[i].y = y;
  }
  n += 2;
  prework();
  long long ret = solve();
  printf("%lld\n", ret);
  return 0;
}
