#include <bits/stdc++.h>
using namespace std;
long long fac[200010], inv[200010], f[2010];
int n, m, cnt;
struct P {
  long long x, y;
} a[2010];
bool cmp(P a, P b) { return (a.x < b.x || (a.x == b.x && a.y < b.y)); }
long long ex_Euclid(long long a, long long b, long long &x, long long &y) {
  if (!b) {
    x = 1, y = 0;
    return a;
  } else {
    long long d = ex_Euclid(b, a % b, y, x);
    y -= x * (a / b);
    return d;
  }
}
long long calc_path(long long x1, long long y1, long long x2, long long y2) {
  return ((fac[x2 - x1 + y2 - y1] * inv[x2 - x1]) % 1000000007LL) *
         inv[y2 - y1] % 1000000007LL;
}
void build() {
  fac[0] = 1;
  for (int i = 1; i < 200010; i++) fac[i] = (fac[i - 1] * i) % 1000000007LL;
  long long tmp;
  for (int i = 1; i < 200010; i++) ex_Euclid(i, 1000000007LL, inv[i], tmp);
  for (int i = 1; i < 200010; i++)
    inv[i] %= 1000000007LL, inv[i] += 1000000007LL, inv[i] %= 1000000007LL;
  for (int i = 2; i < 200010; i++)
    inv[i] = (inv[i] * inv[i - 1]) % 1000000007LL;
  inv[0] = 1;
}
int main() {
  build();
  scanf("%d%d%d", &n, &m, &cnt);
  for (int i = 1; i <= cnt; i++) scanf("%d%d", &a[i].x, &a[i].y);
  a[++cnt].x = n, a[cnt].y = m;
  sort(a + 1, a + cnt + 1, cmp);
  for (int i = 1; i <= cnt; i++) {
    f[i] = calc_path(1, 1, a[i].x, a[i].y);
    for (int j = i - 1; j; j--)
      if (a[j].x <= a[i].x && a[j].y <= a[i].y)
        f[i] = (f[i] + 1000000007LL -
                (f[j] * calc_path(a[j].x, a[j].y, a[i].x, a[i].y)) %
                    1000000007LL) %
               1000000007LL;
  }
  printf("%I64d", f[cnt]);
  return 0;
}
