#include<bits/stdc++.h>
#include<stdio.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef unsigned long long int lu;
typedef vector< int > vi;
typedef vector < ll > vl;
typedef set <ll> sl;
typedef vector< vi > vvi;
typedef vector< vl > vvl;
typedef pair< int,int > ii;
typedef pair< ll,ll > il;
#define sz(a) ll((a).size())
#define test(t) ll t;cin>>t;while(t--)
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define tr(c,i) for(__typeof((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define Vi vector
#define pr pair
#define mpr make_pair
#define fi first
#define se second
#define isnum(a) (a>=48 && a<=57)
#define isS(a) (a>='a' && a<='z')
#define isU(a) (a>='A' && a<='Z')
#define toS(a) (isU(a)?a+32:a)
#define toU(a) (isS(a)?a-32:a)
#define toC(a) a&15

set <ll> s[100005];
ll d[100005];

vector<char> prime (100000+1, true);
void sieve(ll n)
{	
	//O(nloglogn) time
	prime[0] = prime[1] = false;
	for (ll i=2; i<=n; ++i)
	{
		if (prime[i])
		{
			s[i].insert(i);			
			for (ll j=2*i; j<=n; j+=i)
			{
				prime[j] = false;
				s[j].insert(i);
			}
		}
	}
}
#define forn(i,e) for(int i = 0; i < e; i++)
#define rep(i,a,b) for(i=a;i<b;i++)
#define REP(i,a,b) for(i=a;i<=b;i++)
#define reprev(i,a,b) for(i=a;i>=b;i--)

#define leadzero(a) __builtin_clz(a) //count leading zeros
#define trailzero(a) __builtin_ctz(a) //count trailing zeros
#define bitcount(a) __builtin_popcount(a) // count set bits (add ll)
#define ln cout<<"\n"
#define sp cout<<" "
#define maxe(a) *max_element(a.begin(),a.end())
#define maxi(a) max_element(a.begin(),a.end())-a.begin()
#define mine(a) *min_element(a.begin(),a.end())
#define mini(a) min_element(a.begin(),a.end())-a.begin()
ll gcd(ll a, ll b) { if(b == 0) return a; return gcd(b, a % b); }
ll fastpowMOD(ll a, ll p,ll MOD){ if(p==0) return 1; ll z = fastpowMOD(a,p/2,MOD); z = (z*z)%MOD; if(p%2) z = (z*a)%MOD; return z; }
ll fastpow(ll a, ll p){ if(p==0) return 1; ll z = fastpow(a,p/2); z = (z*z); if(p%2) z = (z*a); return z; }

ll search1(ll a[], ll f,ll n)
{
	ll left=1;
	ll right=n+1;
	while(right-left>1)
	{
		ll mid = left + (right-left)/2;
		if(a[mid]<f)
		{
			left=mid;
		}
		else right=mid;
	}
	return a[left];
}
vector<ll> fact,invfact;
const ll MOD = 1e9+7;
ll ways(ll x,ll y)
{
	ll ans = (fact[x+y]*invfact[x])%MOD;
	ans = ans*invfact[y]%MOD;
	ans%=MOD;
	return ans;
}
 
ll modInverse(ll a) 
{ 
    return fastpowMOD(a, MOD-2, MOD);  
} 

int main(){
	ll h,w,n,i,j;
	cin >> h >> w >> n;
	vector<pair<ll,ll> > vwall;
	fact.resize(2e5+2);
	invfact.resize(2e5+2);
	fact[0]=fact[1]=1;
	for(i=2;i<=2e5;i++)
	{
		fact[i]=fact[i-1]*i;
		fact[i]%=MOD;
	}
	invfact[0]=invfact[1]=1;
	for(i=2;i<=2e5;i++)
	{
		invfact[i]=modInverse(fact[i]);
	}
	rep(i,0,n)
	{
		ll a,b;
		cin >> a >> b;
		vwall.pb({a,b});
	}
	vwall.pb({h,w});
	sort(all(vwall));
	vl ans(n+1,0);
	REP(i,0,n)
	{
		ans[i]=ways(vwall[i].fi-1,vwall[i].se-1);
	}
	//cout << endl;
	for(i=0;i<n;i++)
	{
		for(j=i+1;j<=n;j++)
		{
			if(vwall[j].fi<vwall[i].fi || vwall[j].se<vwall[i].se)continue;
			ans[j] -= ans[i]*ways(vwall[j].fi-vwall[i].fi,vwall[j].se-vwall[i].se)%MOD;
			ans[j]%=MOD;
			if(ans[j]<0)ans[j]+=MOD;
		}
	}
	cout << ans[n] << endl;
	return 0;
}
 

Measured memory_bytes: 8320