#include <bits/stdc++.h>
using namespace std;
inline char skipwhitespace() {
  char ch = getchar();
  while (ch == ' ' || ch == '\n' || ch == '\r' || ch == '\t') ch = getchar();
  return ch;
}
void gi(int &x) {
  register int c = getchar();
  x = 0;
  int sn = 1;
  for (; (c < 48 || c > 57); c = getchar())
    if (c == '-') sn = -1;
  for (; c > 47 && c < 58; c = getchar()) {
    x = (x << 1) + (x << 3) + c - 48;
  }
  x *= sn;
}
void gii(long long int &x) {
  register long long int c = getchar();
  x = 0;
  long long int sn = 1;
  for (; (c < 48 || c > 57); c = getchar())
    if (c == '-') sn = -1;
  for (; c > 47 && c < 58; c = getchar()) {
    x = (x << 1) + (x << 3) + c - 48;
  }
  x *= sn;
}
void wi(int n) {
  int sign = n >= 0 ? 1 : -1;
  n = n > 0 ? n : -n;
  char buf[10];
  int i = 9;
  if (!n) buf[i--] = 48;
  while (n) {
    buf[i--] = n % 10 + 48;
    n /= 10;
  }
  if (sign < 0) printf("%c", '-');
  while (++i < 10) printf("%c", buf[i]);
}
void wii(long long int n) {
  long long int sign = n >= 0 ? 1 : -1;
  n = n > 0 ? n : -n;
  char buf[25];
  long long int i = 24;
  if (!n) buf[i--] = 48;
  while (n) {
    buf[i--] = n % 10 + 48;
    n /= 10;
  }
  if (sign < 0) printf("%c", '-');
  while (++i < 25) printf("%c", buf[i]);
}
int gs(char *s) {
  char ch = skipwhitespace();
  int n = 0;
  while ((ch != '\n' && ch != ' ' && ch != '\t')) {
    s[n++] = ch;
    ch = getchar();
  }
  s[n] = 0;
  return n;
}
void ws(char *s) {
  char *p = s;
  while (*p) {
    printf("%c", *p);
    p++;
  }
}
int fact[200005], inv[200005], ans[200005], n, m, k, x, y;
vector<pair<int, int> > vec;
int POW(int a, int b) {
  int ans = 1;
  while (b) {
    if (b & 1) ans = (ans * 1ll * a) % 1000000007;
    b >>= 1;
    a = (a * 1ll * a) % 1000000007;
  }
  return ans;
}
void pre() {
  fact[0] = inv[0] = 1;
  for (int i = 1; i <= 200005 - 1; i++)
    fact[i] = (fact[i - 1] * 1ll * i) % 1000000007,
    inv[i] = POW(fact[i], 1000000007 - 2);
}
int ncr(int x, int y) {
  x--;
  y--;
  int ans = fact[x + y];
  ans = (ans * 1ll * inv[x]) % 1000000007;
  ans = (ans * 1ll * inv[y]) % 1000000007;
  return ans;
}
int main() {
  pre();
  gi(n);
  gi(m);
  gi(k);
  for (int i = 0; i < k; i++) gi(x), gi(y), vec.push_back(make_pair(x, y));
  vec.push_back(make_pair(n, m));
  sort(vec.begin(), vec.end());
  n = vec.size();
  for (int i = 0; i < n; i++) {
    ans[i] = ncr(vec[i].first, vec[i].second);
    for (int j = i - 1; j >= 0; j--) {
      int x = (1000000007 - (ans[j] * 1ll *
                             ncr(vec[i].first - vec[j].first + 1,
                                 vec[i].second - vec[j].second + 1) %
                             1000000007)) %
              1000000007;
      ans[i] = (ans[i] + x) % 1000000007;
    }
  }
  cout << ans[n - 1] << endl;
  return 0;
}
