#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <utility>
#include <ctime>
#include <map>
#include <set>
#include <unordered_set>

using namespace std;

#define endl "\n"
#define X first
#define Y second
#define Z third
#define mp make_pair
#define mt make_triple

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

const ld PI = 3.141592653589793;
const ld E = 2.71828182845904523;
const ll LLINF = 4000000009000000099;
const ll INF = 1009000099;
const ll MOD7 = 1000000007;
const ll MOD9 = 1000000009;

template<class A, class B, class C> struct triple { A first; B second; C third; triple(A, B, C); triple(); };
template<class A, class B, class C> triple<A, B, C>::triple(A a, B b, C c) { first = a; second = b; third = c; }
template<class A, class B, class C> triple<A, B, C>::triple() { }
template<class A, class B, class C> triple<A, B, C> make_triple(A a, B b, C c) { triple<A, B, C> t(a, b, c); return t; }
template<class A, class B, class C> bool operator<(triple<A, B, C> a, triple<A, B, C> b) { if (a.first != b.first) return a.first < b.first; if (a.second != b.second) return a.second < b.second; if (a.third != b.third) return a.third < b.third; }
template<class T> T inline sqr(T a) { return a * a; }

ll bpow(ll a, ll d, ll mod) { if (d == 0) return 1; ll t = bpow(a, d / 2, mod); t = (t * t) % mod; if (d & 1) t = (t * a) % mod; return t; }
ll bpow(ll a, ll d) { if (d == 0) return 1; ll t = bpow(a, d / 2); t = (t * t); if (d & 1) t = (t * a); return t; }
ll gcd(ll a, ll b) { while (a && b) if (a > b) a %= b; else b %= a; return a + b; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
ll C(ll n, ll k) { ll res = 1; for (int i = 1; i <= k; ++i) res = res * (n - k + i) / i; return res; }
ll C(ll n, ll k, ll mod) { ll u = 1, d = 1; for (int i = 2; i <= n; ++i) u = (u * i) % mod; int x = max(k, n - k), z = min(k, n - k); for (int i = 2; i <= x; ++i) { d = (d * i) % mod; if (i <= z) d = (d * i) % mod; } d = bpow(d, mod - 2, mod); ll res = (u * d) % mod; return res; }

using namespace std;

vector<ll> fact;
vector<ll> invf;

ll n_path(ll x, ll y)
{
	return fact[x + y] * invf[x] % MOD7 * invf[y] % MOD7;
}

void solve()
{
	int n, m; cin >> n >> m;
	int k; cin >> k;
	vector<pair<int, int>> v;
	int sz = 2 * 1e5 + 123;
	fact.resize(sz);
	invf.resize(sz);
	fact[0] = 1;
	invf[0] = 1;
	for (int i = 1; i < sz; ++i)
	{
		fact[i] = i * fact[i - 1];
		fact[i] %= MOD7;
		invf[i] = bpow(fact[i], MOD7 - 2, MOD7);
	}

	for (int i = 0; i < k; ++i)
	{
		int x, y;
		cin >> x >> y;
		--x; --y;
		v.push_back({ x, y });
	}	
	v.push_back({ n - 1, m - 1 });
	k++;
	vector<ll> ans(k);

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

	for (int i = 0; i < k; ++i)
	{
		ll cur = n_path(v[i].first, v[i].second);
		for (int j = 0; j < i; ++j)
			if (v[j].first <= v[i].first && v[j].second <= v[i].second)
				cur -= ans[j] * n_path(v[i].first - v[j].first, v[i].second - v[j].second) % MOD7;

		cur = (cur % MOD7 + MOD7) % MOD7;
		ans[i] = cur;
	}

	cout << ans.back();
}

int main() {
	cin.tie(0);
	cout.tie(0);
	ios::sync_with_stdio(0);
#ifdef _DEBUG
	freopen("in.txt", "r", stdin);
#else
#endif
	solve();
	return 0;
}

Measured memory_bytes: 3456