//
//  main.cpp
//

#include <algorithm>
#include <array>
#include <assert.h>
#include <iomanip>
#include <iostream>
#include <limits>
#include <math.h>
#include <memory>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

using ll = int64_t;
using ull = uint64_t;

template<typename T>
vector<T> make_vec_nd(T init, size_t size) {
    return vector<T>(size, init);
}
template<typename T, typename... Args>
auto make_vec_nd(T init, size_t size, Args... rest) {
    auto inner = make_vec_nd(init, rest...);
    return vector<decltype(inner)>(size, inner);
}

namespace Util {
    template<typename INT>
    INT gcd_with_coef(INT x, INT y, INT* outCX, INT* outCY);
};    // namespace Util

template<typename INT>
INT Util::gcd_with_coef(INT x, INT y, INT* outCX, INT* outCY) {
    if (x < 0) {
        INT d = gcd_with_coef(-x, y, outCX, outCY);
        *outCX *= -1;
        return d;
    }
    if (y < 0) {
        INT d = gcd_with_coef(x, -y, outCX, outCY);
        *outCY *= -1;
        return d;
    }
    if (x > y) {
        return gcd_with_coef(y, x, outCY, outCX);
    }
    if (x == 0) {
        if (outCX != nullptr && outCY != nullptr) {
            *outCX = 0;
            *outCY = 1;
        }
        return y;
    }
    INT q = y / x;
    INT r = y % x;
    INT d = gcd_with_coef(r, x, outCY, outCX);
    if (outCX != nullptr && outCY != nullptr) {
        *outCX -= q * *outCY;
    }
    return d;
}

struct Mod {
    static ll BASE;
    ll value = 0;
    static ll residue(ll value) { return (value % BASE + BASE) % BASE; }
    Mod(ll value)
    : value(residue(value)) {}
    Mod operator+(const Mod& rhs) const { return Mod(value + rhs.value); }
    void operator+=(const Mod& rhs) { *this = *this + rhs; }
    Mod operator-(const Mod& rhs) const { return Mod(value - rhs.value); }
    void operator-=(const Mod& rhs) { *this = *this - rhs; }
    Mod operator*(const Mod& rhs) const { return Mod(value * rhs.value); }
    void operator*=(const Mod& rhs) { *this = *this * rhs; }
    Mod operator/(const Mod& rhs) const { return *this * rhs.inv(); }
    void operator/=(const Mod& rhs) { *this = *this / rhs; }
    Mod inv() const {
        if (value == 0) {
            assert(false);
            throw "[Mod::inv] div by zero";
        }
        ll ans, sub;
        ll d = Util::gcd_with_coef<ll>(value, BASE, &ans, &sub);
        if (d != 1) {
            assert(false);
            throw "[Mod::inv] not invertible";
        }
        return ans;
    }
};
ll Mod::BASE = 1000000007;

vector<Mod> fact_table(200001, (Mod)1);
vector<Mod> fact_inv_table(200001, (Mod)1);

Mod binom(ll n, ll r) {
	return fact_table[n] * fact_inv_table[r] * fact_inv_table[n-r];
}

int main() {
    ll H, W, N;
    cin >> H >> W >> N;
    set<ll> xs;
    unordered_map<ll, set<ll>> ys;
    for (ll i = 0; i < N; i++) {
        ll r, c;
        cin >> r >> c;
        r--;
        c--;
        xs.insert(c);
        ys[c].insert(r);
    }
    vector<pair<ll, ll>> points;
    for (ll x : xs) {
    	for (ll y : ys[x]) {
    		points.push_back(pair<ll, ll>{x, y});
    	}
    }
    points.push_back(pair<ll, ll>{W-1, H-1});
    for (ll i = 1; i <= H+W; i++) {
        fact_table[i] = fact_table[i-1] * i;
    }
    for (ll i = 1; i <= H+W; i++) {
        fact_inv_table[i] = fact_inv_table[i-1] / i;
    }
    auto dp = make_vec_nd((Mod)0, points.size()+1, points.size());
    for (ll n = 0; n <= points.size(); n++) {
        for (ll end = 0; end < points.size(); end++) {
            if (n == 0) {
                ll a = points[end].first + points[end].second;
                ll b = points[end].first;
                dp[0][end] = binom(a, b);
            } else {
                if (n-1 != end && points[n-1].first <= points[end].first
                    && points[n-1].second <= points[end].second) {
                    ll a = (points[end].first - points[n-1].first)
                            + (points[end].second - points[n-1].second);
                    ll b = points[end].first - points[n-1].first;
                    dp[n][end] = dp[n-1][end] - dp[n-1][n-1] * binom(a, b);
                } else {
                    dp[n][end] = dp[n-1][end];
                }
            }
        }
    }
    cout << dp[points.size()][points.size()-1].value << endl;
}


Measured memory_bytes: 74496