#include <bits/stdc++.h>
using namespace std;
const int m = 1e9 + 7;
int h, w, n, fact[200012], rfact[200012], way[200012];
pair<int, int> n00b[100012];
inline void M(int &x) { x < 0 ? x += m : x %= m; }
inline int Pow(int a, int b) {
  int ans = 1;
  while (b) {
    ans = (long long int)ans * (b & 1 ? a : 1) % m;
    a = (long long int)a * a % m;
    b >>= 1;
  }
  return ans;
}
inline int c(int n, int r) {
  return ((((long long int)fact[n] * rfact[r]) % m) * rfact[n - r]) % m;
}
inline void start() {
  fact[0] = 1;
  for (int i = 1; i < 200012; i++)
    fact[i] = ((long long int)fact[i - 1] * i) % m;
  for (int i = 0; i < 200012; i++) rfact[i] = Pow(fact[i], m - 2);
  return;
}
int main() {
  start();
  cin >> h >> w >> n;
  for (int i = 0; i < n; i++)
    cin >> n00b[i].first >> n00b[i].second, n00b[i].first--, n00b[i].second--;
  sort(n00b, n00b + n);
  n00b[n] = {h - 1, w - 1};
  for (int i = 0; i <= n; i++) {
    way[i] = c(n00b[i].first + n00b[i].second, n00b[i].first);
    for (int j = 0; j < i; j++)
      if (n00b[j].second <= n00b[i].second)
        way[i] -=
            ((long long int)way[j] *
             c(n00b[i].first - n00b[j].first + n00b[i].second - n00b[j].second,
               n00b[i].second - n00b[j].second)) %
            m,
            M(way[i]);
  }
  cout << way[n] << endl;
  return 0;
}
