#include "bits/stdc++.h"
using namespace std;
/////////////////// TYPES & MACROS ///////////////////////////////
#define mp make_pair
#define eb emplace_back
#define pb push_back
#define all(x) x.begin(),x.end()
#define ff first
#define ss second
#define vv vector
#define exist(s,e) (s.find(e)!=s.end())
#define sz(x) ((int)(x).size())
#define int ll
#define el '\n'
typedef long long ll; typedef long double ld; typedef double dd;typedef vector<int> vi; typedef pair<int, int> pii;typedef pair<ll,ll> pll;
const ll INFLL=(ll)4e18, MOD=1e9+7; const int INF=0x3f6f6f6f;
//////////////////// DEBUG /////////////////////////////////////////
#define D(x) cerr<<#x<<" is:\t"<<x<<'\n';
#define DD(x,y) cerr<<'('<<#x<<','<<#y<<") are:\t"<<x<<' '<<y<<'\n';
#define DDD(x,y,z) cerr<<'('<<#x<<','<<#y<<','<<#z<<") are:\t"<<x<<' '<<y<<' '<<z<<'\n';
/////////////////// VARIABLES & FUNCTIONS//////////////////////////
vv<vv<int>> adj; vi vis, color, level; int dx8[]={0,1,1,1,0,-1,-1,-1}, dy8[]={1,1,0,-1,-1,-1,0,1},dx4[]={0,1,0,-1}, dy4[]={1,0,-1,0};
inline ll mexp(ll x,ll n,ll m=MOD){ll res=1;x%=m;while(n){if(n&1)res=(res*x)%m;n>>=1;x=(x*x)%m;}return res;}
inline ll gcd(ll a, ll b){while (a>0 && b>0){if(a>b)a%=b;else b%=a;}return a+b;}

template <int MOD=MOD>
class Modular {
 public:
  Modular(long long v = 0) {
    value = v % MOD;
    if (value < 0) value += MOD;
  }

  Modular(long long a, long long b) : value(0) {
    *this += a;
    *this /= b;
  }

  Modular& operator+=(Modular const& b) {
    value += b.value;
    if (value >= MOD) value -= MOD;
    return *this;
  }

  Modular& operator-=(Modular const& b) {
    value -= b.value;
    if (value < 0) value += MOD;
    return *this;
  }

  Modular& operator*=(Modular const& b) {
    value = (long long)value * b.value % MOD;
    return *this;
  }

  friend Modular mexp(Modular a, long long e) {
    Modular res = 1;
    while (e) {
      if (e & 1) res *= a;
      a *= a;
      e >>= 1;
    }
    return res;
  }

  friend Modular inverse(Modular a) { return mexp(a, MOD - 2); }

  Modular& operator/=(Modular const& b) { return *this *= inverse(b); }

  friend Modular operator+(Modular a, Modular const b) { return a += b; }

  friend Modular operator-(Modular a, Modular const b) { return a -= b; }

  friend Modular operator-(Modular const a) { return 0 - a; }

  friend Modular operator*(Modular a, Modular const b) { return a *= b; }

  friend Modular operator/(Modular a, Modular const b) { return a /= b; }

  friend std::ostream& operator<<(std::ostream& os, Modular const& a) {
    return os << a.value;
  }

  friend bool operator==(Modular const& a, Modular const& b) {
    return a.value == b.value;
  }

  friend bool operator!=(Modular const& a, Modular const& b) {
    return a.value != b.value;
  }

  int value;
  static const int MOD_value = MOD;
};

Modular<> ncr(ll a, ll b){
	static bool cached=false;
	const static int size=2e5+10;
	static vv<Modular<>> fac(size+1), ifac(size+1);
	if(!cached){
//		cout<<"computing"<<el;
		fac[0]=ifac[0]=1;
		for(int i=1;i<=size;++i) fac[i]=i*fac[i-1];
		ifac[size]=mexp(fac[size],MOD-2);
		for(int i=size-1;i>0;--i) ifac[i]=(i+1)*ifac[i+1];
		cached=true;
	}
	return fac[a]*ifac[b]*ifac[a-b];
}
///////////////////// MAIN STARTS //////////////////////////////////
int32_t main(void){
ios_base::sync_with_stdio(false);cin.tie(NULL); cout.tie(NULL);
cout<<fixed;cerr<<fixed; cout<<setprecision(10); cerr<<setprecision(3);
mt19937 genr(chrono::high_resolution_clock::now().time_since_epoch().count());

int h,w,n; cin>>h>>w>>n;
vv<pii> pts{{h,w}};
vv<Modular<>> dp;
for(int i=0;i<n;++i){
	int l,r; cin>>l>>r;
	pts.eb(l,r);
}
sort(all(pts));
dp.resize(sz(pts),0);
n=sz(pts);
for(int i=0;i<n;++i){
	dp[i]+=ncr(pts[i].ff+pts[i].ss-2, pts[i].ff-1);	
	for(int j=i+1;j<n;++j){
		if(pts[j].ss>=pts[i].ss)
			dp[j]-=dp[i]*ncr(pts[j].ff-pts[i].ff+pts[j].ss-pts[i].ss, pts[j].ff-pts[i].ff);
	}
}
//for(int i=0;i<n;++i) cout<<dp[i]<<' '; cout<<endl;
cout<<dp.back() <<el;

return 0;
}


Measured memory_bytes: 3456