#include <bits/stdc++.h>
 
#define ll long long
#define X first
#define Y second
#define MP make_pair
 
using namespace std;

const int N = 3e5 + 123;
const ll mod = 1e9 + 7;             

int n, h, w;
pair<int, int> a[N];
ll f[N], dp[N];
vector<int> srt;

ll bin_pow(ll x, ll y){
	ll res = 1;
	while(y){
		if(y & 1ll)
			res = res * x % mod;
		x = x * x % mod;
		y >>= 1LL;
	}
	return res;
}

ll calc(ll x, ll y){
	x -= 1, y -= 1;
	return f[x + y] * bin_pow(f[x], mod - 2) % mod * bin_pow(f[y], mod - 2) % mod;	
}

int main () {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);	

	f[0] = 1;
	for(ll i = 1;i <= 300000;i++){
		f[i] = f[i - 1] * i % mod;
	}

	cin >> h >> w >> n;
	for(int i = 1;i <= n;i++){
		int x, y;
		cin >> x >> y;
		a[i] = MP(x, y);
	}
	a[++n] = MP(h, w);

	sort(a + 1, a + n + 1);
	for(int i = 1;i <= n;i++){
		srt.push_back(i);
		sort(srt.begin(), srt.end(), 
			[a](int x, int y){
				return a[x].Y < a[y].Y;
			}
		);		
		ll all = calc(a[i].X, a[i].Y);
		for(int j: srt){
			if(j == i)
				break;
			all = (all - (dp[j] * calc(abs(a[j].X - a[i].X) + 1, abs(a[j].Y - a[i].Y) + 1) % mod) + mod) % mod;
		}
		dp[i] = all;
	}
	cout << dp[n];
	return 0;
}
