#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;

// Finite field Z/pZ
class ModInt{
private:
  long long val;
  static const int default_mod = 1e9 + 7;
  static int mod;
public:
  ModInt(long long val)
  {
    this->val = val % getMod();
    if(this->val < 0){
      this->val += getMod();
    }
  }
  ModInt()
    : ModInt(0)
  {
  }
  static void setMod(int mod){
    if(ModInt::mod != 0){
      throw "The modulo is already set.";
    }
    ModInt::mod = mod;
  }
  inline static int getMod(){
    if(mod == 0){
      mod = default_mod;
    }
    return mod;
  }
  inline long long getVal() const{
    return val;
  }

  
  ModInt& operator+=(const ModInt&);
  ModInt& operator-=(const ModInt&);
  ModInt& operator*=(const ModInt&);
  ModInt& operator/=(const ModInt&);

  ModInt pow(long long exponent) const{
    exponent %= getMod() - 1;
    long long pow_val = this->val;
    long long ret_val = 1;
    while(exponent > 0){
      if(exponent % 2 == 1){
        ret_val = (ret_val * pow_val) % getMod();
      }
      pow_val = (pow_val * pow_val) % getMod();
      exponent /= 2;
    }
    return ModInt(ret_val);
  }
  ModInt inv() const{
    return this->pow(getMod() - 2);
  }
  friend ostream& operator<< (ostream& os, const ModInt& modint){
    os << modint.val;
    return os;
  }
  friend istream& operator>>(istream& is, ModInt& modint){
    long long val;
    is >> val;
    modint.val = val % modint.getMod();
    return is;
  }
};

int ModInt::mod = 0;

const ModInt operator+(const ModInt& lhs, const ModInt& rhs){
  return ModInt(lhs.getVal() + rhs.getVal());
}
const ModInt operator-(const ModInt& lhs, const ModInt& rhs){
  return ModInt(lhs.getVal() - rhs.getVal());
}
const ModInt operator*(const ModInt& lhs, const ModInt& rhs){
  return ModInt(lhs.getVal() * rhs.getVal());
}
const ModInt operator/(const ModInt& lhs, const ModInt& rhs){
  return lhs.getVal() * rhs.inv();
}


ModInt& ModInt::operator+=(const ModInt& rhs){
  (*this) = (*this) + rhs;
  return *this;
}
ModInt& ModInt::operator-=(const ModInt& rhs){
  (*this) = (*this) - rhs;
  return *this;
}
ModInt& ModInt::operator*=(const ModInt& rhs){
  (*this) = (*this) * rhs;
  return *this;
}
ModInt& ModInt::operator/=(const ModInt& rhs){
  (*this) = (*this) / rhs;
  return *this;
}

class ModIntComb{
private:
  vector<ModInt> facts;
  vector<ModInt> fact_invs;
  int n_max;
public:
  ModIntComb(int n_max): n_max(n_max){
    facts.push_back(1);
    for(int i = 1; i <= n_max; i++){
      facts.push_back(facts[i - 1] * i);
    }
    fact_invs = vector<ModInt>(n_max + 1);
    fact_invs[n_max] = facts[n_max].inv();
    for(int i = n_max - 1; i >= 0; i--){
      fact_invs[i] = fact_invs[i + 1] * (i + 1);
    }
  }
  int getNMax(){
    return n_max;
  }
  ModInt fact(int n){
    return facts[n];
  }
  ModInt fact_inv(int n){
    return fact_invs[n];
  }
  ModInt comb(int n, int k){
    if(k < 0 || k > n){
      return 0;
    }
    return facts[n] * fact_invs[k] * fact_invs[n - k];
  }
};

int main(){
  int H, W, N;
  cin >> H >> W >> N;

  vector<pair<int, int>> rc(N + 1);
  for(int i = 0; i < N; i++){
    int r, c;
    cin >> r >> c;
    r--;
    c--;
    rc[i] = make_pair(r, c);
  }
  rc[N] = make_pair(H - 1, W - 1);

  // rc being sorted, there is no path from rc[i] to rc[j] if i > j
  sort(rc.begin(), rc.end());


  auto mic = ModIntComb(2 * 1e5);
  // dp[i] := the number of paths from (0, 0) to rc[i],
  // without passing rc[j] for any j < i.
  vector<ModInt> dp(N + 1);
  for(int i = 0; i <= N; i++){
    int ri = rc[i].first, ci = rc[i].second;
    dp[i] = mic.comb(ri + ci, ri);
    for(int j = 0; j < i; j++){
      int rj = rc[j].first, cj = rc[j].second;
      if(rj <= ri && cj <= ci){
        dp[i] -= dp[j] * mic.comb(ri - rj + ci - cj, ri - rj);
      }
    }
  }
  cout << dp[N] << endl;
}
  


Measured memory_bytes: 3568