#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
const int inf = 0x3f3f3f3f;
const int maxn = 2000 + 10;
long long MOD = 1e9 + 7;
long long fac[200010];
void getFac() {
  fac[0] = 1;
  for (int i = 1; i < 200010; i++) {
    fac[i] = fac[i - 1] * i % MOD;
  }
}
long long powerMod(long long x, long long n) {
  long long ans = 1;
  x %= MOD;
  while (n > 0) {
    if (n & 1) {
      ans = (ans * x) % MOD;
    }
    x = (x * x) % MOD;
    n >>= 1;
  }
  return ans;
}
long long C(long long n, long long m) {
  if (m > n) {
    return 0;
  } else {
    return fac[n] * powerMod(fac[m] * fac[n - m], MOD - 2) % MOD;
  }
}
long long Lucas(long long n, long long m) {
  if (m == 0) {
    return 1;
  } else {
    return C(n % MOD, m % MOD) * Lucas(n / MOD, m / MOD) % MOD;
  }
}
struct Point {
  int r, c;
  Point(int a = 0, int b = 0) {
    r = a;
    c = b;
  }
};
bool operator<(const Point& a, const Point& b) {
  return a.r < b.r || (a.r == b.r && a.c < b.c);
}
int h, w, n;
Point point[maxn];
vector<int> G[maxn];
long long dp[maxn];
long long dfs(int u) {
  if (dp[u] >= 0) {
    return dp[u];
  }
  long long ret = Lucas(h - point[u].r + w - point[u].c, h - point[u].r);
  int glen = G[u].size();
  for (int i = 0; i < glen; i++) {
    int v = G[u][i];
    ret = (ret - Lucas(point[v].r - point[u].r + point[v].c - point[u].c,
                       point[v].r - point[u].r) *
                     dfs(v)) %
          MOD;
  }
  return dp[u] = (ret + MOD) % MOD;
}
int main() {
  getFac();
  scanf("%d%d%d", &h, &w, &n);
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &point[i].r, &point[i].c);
  }
  point[n++] = Point(1, 1);
  point[n++] = Point(h, w);
  sort(point, point + n);
  for (int i = 0; i < n - 1; i++) {
    for (int j = i + 1; j < n; j++) {
      { G[i].push_back(j); }
    }
  }
  for (int i = 0; i < n; i++) {
    dp[i] = -1;
  }
  dp[n - 1] = 0;
  long long ans = dfs(0);
  printf("%I64d\n", ans);
  return 0;
}
