#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int x, long long int y) {
  return y == 0 ? x : gcd(y, x % y);
}
long long int power(long long int x, long long int y) {
  long long int temp = 1;
  while (y > 0) {
    if (y & 1) temp = (temp * x);
    x *= x;
    y /= 2;
  }
  return temp;
}
bool isPalin(string x) {
  long long int len = x.length();
  for (int i = 0; i <= (len / 2) - 1; ++i) {
    if (x[i] != x[len - 1 - i]) return false;
  }
  return true;
}
string tolowerStr(string x) {
  string ret = "";
  for (int i = 0; i <= (long long int)x.length() - 1; ++i) {
    ret.push_back(tolower(x[i]));
  }
  return ret;
}
string toupperStr(string x) {
  string ret = "";
  for (int i = 0; i <= (long long int)x.length() - 1; ++i) {
    ret.push_back(toupper(x[i]));
  }
  return ret;
}
long long int modulo(long long int a, long long int b, long long int c) {
  long long int x = 1;
  long long int y = a;
  while (b > 0) {
    if (b % 2 == 1) {
      x = (x * y) % c;
    }
    y = (y * y) % c;
    b /= 2;
  }
  return x % c;
}
long long int mulmod(long long int a, long long int b, long long int c) {
  long long int x = 0;
  long long int y = a % c;
  while (b > 0) {
    if (b % 2 == 1) {
      x = (x + y) % c;
    }
    y = (y * 2) % c;
    b /= 2;
  }
  return x % c;
}
long long int DigitSum(long long int n) {
  long long int temp = 0;
  n = ((n) < 0 ? -(n) : (n));
  while (n) {
    temp += (n % 10);
    n /= 10;
  }
  return temp;
}
bool double_equals(double a, double b, double epsilon = 0.1) {
  return std::abs(a - b) < epsilon;
}
bool comp(pair<long long int, long long int> a,
          pair<long long int, long long int> b) {
  if (a.first < b.first)
    return true;
  else if (a.first > b.first)
    return false;
  else {
    if (a.second > b.second)
      return true;
    else
      return false;
  }
}
vector<pair<long long int, long long int> > v;
long long int fact[200005];
long long int inv_fact[200005];
long long int ways[200005];
void factorial() {
  fact[0] = 1;
  inv_fact[0] = 1;
  for (int i = 1; i <= 200004; ++i) {
    fact[i] = (fact[i - 1] * i) % 1000000007;
  }
  for (int i = 1; i <= 200004; ++i) {
    inv_fact[i] = modulo(fact[i], 1000000007 - 2, 1000000007);
  }
}
long long int num_of_ways(long long int x1, long long int y1, long long int x2,
                          long long int y2) {
  long long int n, m, res;
  n = x2 - x1;
  m = y2 - y1;
  res = (((fact[n + m] * inv_fact[n]) % 1000000007) * inv_fact[m]) % 1000000007;
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  factorial();
  long long int h, w, n, a, b;
  cin >> h >> w >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> a >> b;
    v.push_back(make_pair(a, b));
  }
  v.push_back(make_pair(h, w));
  sort(v.begin(), v.end());
  for (int i = 0; i <= (int)v.size() - 1; ++i) {
    ways[i] = num_of_ways(1, 1, v[i].first, v[i].second);
  }
  for (int i = 0; i <= (int)v.size() - 2; ++i) {
    for (int j = i + 1; j <= (int)v.size() - 1; ++j) {
      if (v[j].first < v[i].first || v[j].second < v[i].second) continue;
      ways[j] -= ((ways[i] * num_of_ways(v[i].first, v[i].second, v[j].first,
                                         v[j].second)) %
                      1000000007 +
                  1000000007) %
                 1000000007;
      ways[j] = (ways[j] + 1000000007) % 1000000007;
    }
  }
  long long int dest = (int)v.size() - 1;
  cout << ways[dest] << endl;
  return 0;
}
