#include<bits/stdc++.h>
#include<iostream>
#include<cmath>
#include<vector>
#include<string>
#include<queue>
#include<set>
#include<map>
#include<algorithm>
#include<functional>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef pair<ull, ull> pullull;
typedef pair<ll, int> plli;
typedef pair<int, pii> pipii;
typedef vector<vector<int> > mati;
typedef vector<vector<double> > matd;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef vector<vector<vector<ll>>> vvvll;
typedef vector<bool> vb;
typedef vector<vector<bool>> vvb;
typedef vector<vector<vector<bool>>> vvvb;

#define FOR(i,x,y) for(ll i=(ll)x; i<(ll)y; ++i)
#define REP(i,y) FOR(i, 0, y)

template <typename T>
void vec_print(vector<T> VEC){
  REP(i, VEC.size()){
    cout << VEC[i] << " ";
  }
  cout << "\n";
};

template <typename T>
void mat_print(vector<vector<T> > MAT){
  REP(i, MAT.size()){
    REP(j, MAT[i].size()){
      cout << MAT[i][j] << " ";
    }
    cout << "\n";
  }
};

template <typename CLASS1, typename CLASS2>
class HOGE{
  public:
    CLASS1 key;
    CLASS2 value;
    HOGE(void){
      return;
    };
    HOGE(CLASS1 key, CLASS2 value){
      this->key = key;
      this->value = value;
    };
    ~HOGE(void){
      return;
    };

    void print(void){
      cout << "key : " << key << ", value : " << value << "\n";
      return;
    };
    
    bool operator==(const HOGE &obj){
      return (this->value == obj.value);
    };
    bool operator<(const HOGE &obj){
      if(this->value == obj.value){
        return (this->key < obj.key);
      }
      return (this->value < obj.value);
    };
    bool operator>(const HOGE &obj){
      if(this->value == obj.value){
        return (this->key > obj.key);
      }
      return (this->value > obj.value);
    };
};

constexpr int INF = (1<<30);
constexpr ll INFLL = 1LL<<62;
constexpr long double EPS = 1e-12;
constexpr ll MOD = (ll)((1E+9)+7);

class MODCOM{
  //nCr
  private:
    const ll MAX = 1000000;
    vll fac, finv, inv;
  public:
    MODCOM(void){
      fac.resize(MAX);
      finv.resize(MAX);
      inv.resize(MAX);

      fac[0] = fac[1] = 1;
      finv[0] = finv[1] = 1;
      inv[1] = 1;
      for(int i=2; i<MAX; ++i){
        fac[i] = fac[i-1]*i%MOD;
        inv[i] = MOD-inv[MOD%i]*(MOD/i)%MOD;
        finv[i] = finv[i-1]*inv[i]%MOD;
      }
    };

    ~MODCOM(void){
      return;
    };

    ll calc(ll n, ll k){
      if(n<k) return 0;
      if(n<0 || k<0) return 0;
      return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD;
    };
};

MODCOM com;

ll f(ll x, ll y){
  if(x<0) return 0;
  if(y<0) return 0;
  return com.calc(x+y, x);
}

int main(){
  cin.tie(0); // cut the cin and cout (default, std::flush is performed after std::cin)
  ios::sync_with_stdio(false); // cut the iostream and stdio (DON'T endl; BUT "\n";)

  ll H, W, N;
  cin >> H >> W >> N;
  vector<HOGE<ll, ll>> pos(N+1);
  REP(i, N){
    ll r, c;
    cin >> r >> c;
    r--; c--;
    HOGE<ll, ll> tmp(r, c);
    pos[i] = tmp;
  }
  HOGE<ll, ll> tmp(H-1, W-1);
  pos[N] = tmp;

  sort(pos.begin(), pos.end());

  vll dp(N+1, 0);

  REP(i, N+1){
    dp[i] = f(pos[i].key, pos[i].value)%MOD;
    REP(j, i){
      dp[i] -= (dp[j]*f(pos[i].key-pos[j].key, pos[i].value-pos[j].value))%MOD;
    }
    while(dp[i]<0) dp[i]+=MOD;
  }

  cout << dp[N] << "\n";

  return 0;
}


Measured memory_bytes: 23808