#include <bits/stdc++.h>
using namespace std;
;
template <class T>
bool io(T &res) {
  static char c = ' ';
  while (c == ' ' || c == '\n') c = getchar_unlocked();
  if (c == -1) return 0;
  res = ((c) - '0');
  while ((c = getchar_unlocked()) && c != ' ' && c != '\n' && c != -1) {
    res = (res << 3) + (res << 1) + ((c) - '0');
  }
  return 1;
}
template <class T>
string inttostr(T x) {
  string res = "";
  while (x) {
    char t = ((x % 10) + '0');
    x /= 10;
    res = t + res;
  }
  return res;
}
template <class T>
T strtoint(string x) {
  T res = 0;
  for (int i = 0; i < x.size(); i++) {
    res = (res << 3) + (res << 1) + ((x[i]) - '0');
  }
  return res;
}
void open(string a) {
  freopen((a + ".in").c_str(), "r", stdin);
  freopen((a + ".out").c_str(), "w", stdout);
}
void close() {
  fclose(stdin);
  fclose(stdout);
}
int R, C, N;
long long fak[300000 + 5];
long long inv[300000 + 5];
pair<long long, long long> arr[3005];
long long val[3005];
long long modexp(long long a, int b) {
  long long ret = 1;
  for (; b; a = (a * a) % 1000000007, b >>= 1)
    if (b & 1) ret = (ret * a) % 1000000007;
  return ret;
}
void init() {
  fak[0] = 1;
  inv[0] = 1;
  for (int i = 1; i <= 300000; i++) {
    fak[i] = (fak[i - 1] * (long long)i) % 1000000007;
    inv[i] = modexp(fak[i], 1000000007 - 2);
  }
}
long long comb(long long a, long long b) {
  long long ret;
  ret = (fak[a] * inv[b]) % 1000000007;
  ret = (ret * inv[a - b]) % 1000000007;
  return ret;
}
int main() {
  ios::sync_with_stdio(0);
  init();
  cin >> R >> C >> N;
  for (int i = 0; i < N; i++) {
    cin >> arr[i].first >> arr[i].second;
    arr[i].first--;
    arr[i].second--;
  }
  sort(arr, arr + N);
  arr[N] = {R - 1, C - 1};
  for (int i = 0; i <= N; i++) {
    val[i] = comb(arr[i].first + arr[i].second, arr[i].first);
  }
  for (int i = 0; i < N; i++) {
    long long value = val[i];
    for (int j = i + 1; j <= N; j++) {
      if (arr[i].first <= arr[j].first && arr[i].second <= arr[j].second) {
        long long X = arr[j].first - arr[i].first;
        long long Y = arr[j].second - arr[i].second;
        long long mul = (comb(X + Y, X) * value) % 1000000007;
        val[j] = (val[j] - mul) % 1000000007;
        while (val[j] < 0) val[j] += 1000000007;
      }
    }
    val[i] = 0;
  }
  cout << val[N] << '\n';
  return 0;
}
