#include <bits/stdc++.h>
using namespace std;

using ld = double;
using ll = long long;
using ull = unsigned long long;
const int INF = 1 << 30;
const ll LINF = 1LL << 60;

const int SZ = 1 << 13;
char buff[SZ], *pos = buff + SZ - 1;
#define getchar() ++ pos == buff + SZ ? fread(pos = buff, 1, SZ, stdin), *pos : *pos

inline ll read() {
	ll x = 0; int f = 1, c = getchar();
	for (;!isdigit(c); c = getchar()) if (c == '-') f = -f;
	for (; isdigit(c); c = getchar()) x = (x<<3) + (x<<1) + (c^48);
	return x * f;
}

struct P {
	int x, y;
	P() {}
	P(int a,int b): x(a), y(b) {}
	bool operator < (const P &a) const { return x != a.x ? x < a.x : y < a.y; }
};

const int mod = 1e9 + 7;

int qp(int x, int n) { int ans = 1; for (; n; n >>= 1, x = 1LL * x * x % mod) if (n & 1) ans = 1LL * ans * x % mod; return ans; }
vector <int> fac, invfac;
int C(int x, int y) { return 1LL * fac[x] * invfac[y] % mod * invfac[x - y] % mod; }

//map <P, int> dp;
int h, w, n;
vector <P> wall;
vector <int> dp;
//set <P> wall;
//vector <int> vx;
//map <int, vector <int> > vy;

//int DP(int x, int y) {
//	if (wall.count(P(x, y))) return 0;
//	if (dp.count(P(x, y))) return dp[P(x, y)];
//	int res = 0;
//	int X = -1, Y = -1;
//	int __ = upper_bound(vx.begin(), vx.end(), x) - vx.begin();
//	for (int i = __ - 1; ~i; -- i) {
//		int ___ = upper_bound(vy[vx[i]].begin(), vy[vx[i]].end(), y) - vy[vx[i]].begin();
//		if (!___) continue;
//		int j = ___ - 1;
//		X = vx[i], Y = vy[X][j];
//		break;
//	}
//	if (!~X) return dp[P(x, y)] = C(x + y - 2, x - 1);
//	if (Y > 1) for (int xx = X + 1; xx <= x; ++ xx) {
//		res = (res + 1LL * DP(xx, Y - 1) * C(x - xx + y - Y, x - xx) % mod) % mod;
//	}
//	if (X > 1) for (int yy = Y + 1; yy <= y; ++ yy) {
//		res = (res + 1LL * DP(X - 1, yy) * C(x - X + y - yy, x - X) % mod) % mod;
//	}
//	return dp[P(x, y)] = res;
//}

int main() {
	fac.push_back(1), invfac.push_back(1);
	for (int i = 1; i <= 2e5; ++ i) {
		fac.push_back(1LL * fac.back() * i % mod);
		invfac.push_back(qp(fac.back(), mod - 2));
	}
	h = read(), w = read(), n = read();
	for (int i = 0; i < n; ++ i) {
		int x = read(), y = read();
		wall.push_back(P(x, y));
//		wall.insert(P(x, y));
//		vx.push_back(x);
//		vy[x].push_back(y);
	}
	wall.push_back(P(h, w));
	sort(wall.begin(), wall.end());
//	for (int i = 0; i < (int) wall.size(); ++ i)
//		printf("%d %d\n", wall[i].x, wall[i].y);
	dp.resize(wall.size());
	for (int i = 0; i < (int) wall.size(); ++ i) {
		dp[i] = C(wall[i].x + wall[i].y - 2, wall[i].x - 1);
		for (int j = 0; j < i; ++ j) {
			if (wall[j].y <= wall[i].y) dp[i] = (dp[i] + mod - 1LL * dp[j] * C(wall[i].x - wall[j].x + wall[i].y - wall[j].y, wall[i].x - wall[j].x) % mod) % mod;
		}
	}
	printf("%d\n", dp[wall.size() - 1]);
//	sort(vx.begin(), vx.end());
//	vx.erase(unique(vx.begin(), vx.end()), vx.end());
//	for (pair <const int, vector <int> > &p : vy) {
//		vector <int> &v = p.second;
//		sort(v.begin(), v.end());
//		v.erase(unique(v.begin(), v.end()), v.end());
//	}
//	printf("%d\n", DP(h, w));
	return 0;
}
// ----------
// |+       |
// |-+      |
// | -+     |
// |  -     |
// |  -+++  |
// |     -++|
// ----------
// find n numbers which the first one is >= 1, and the rest are >= 0, and their sum is m.
// C(n+m-2,n-1) 

Measured memory_bytes: 2036