#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <deque>
#include <list>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>

using namespace std;

//typedef
typedef long long LL;
typedef vector<LL> VL;
typedef vector<VL> VVL;
typedef vector<string> VS;
typedef pair<LL, LL> PLL;

//conversion
inline LL toLong(string s) {LL v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) LL((a).size())
#define EACH(i,c) for(auto i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
#define FOR(i,a,b) for(LL i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define UNTIL(p) while(!(p))

//constant
const double EPS = 1e-5;
const double PI  = acos(-1.0);

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

#define PUTS(x) cout << (x) << endl;

const LL MOD = 1e9 + 7;

class ModCombination{
    vector<LL> fact_, inv_, finv_;
public:
    ModCombination() {}
    ModCombination(LL n) noexcept : fact_(n, 1), inv_(n, 1), finv_(n, 1) {
        init(n);
    }
    void init(LL n) noexcept {
        fact_.assign(n, 1), inv_.assign(n, 1), finv_.assign(n, 1);
        for(LL i = 2; i < n; i++){
            fact_[i] = fact_[i-1] * i % MOD;
            inv_[i] = MOD - inv_[MOD%i] * (MOD/i) % MOD;
            finv_[i] = finv_[i-1] * inv_[i] % MOD;
        }
    }
    LL comb(LL n, LL k) const noexcept {
        if (n < k || n < 0 || k < 0) return 0;
        return fact_[n] * (finv_[k] * finv_[n-k] %MOD) % MOD;
    }
    LL fact(LL n) const noexcept {
        if (n < 0) return 0;
        return fact_[n];
    }
    LL inv(LL n) const noexcept {
        if (n < 0) return 0;
        return inv_[n];
    }
    LL finv(LL n) const noexcept {
        if (n < 0) return 0;
        return finv_[n];
    }
};

LL dp[3005] = {0};
ModCombination mc(200005);

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

    LL h,w,n;
    cin>>h>>w>>n;

    vector<PLL> points;
    points.PB(MP(0,0));
    points.PB(MP(h-1,w-1));
    REP(i,n){
        LL r,c;
        cin>>r>>c;
        r--;
        c--;
        points.PB(MP(r,c));
    }
    SORT(points);

    FOR(i,1,n + 2){
        LL r = points[i].first;
        LL c = points[i].second;
        LL sum = 0;
        FOR(j,1,i){
            LL dy = r - points[j].first;
            LL dx = c - points[j].second;
            sum += (dp[j] * mc.comb(dx + dy, dx)) % MOD;
            sum %= MOD;
        }
        dp[i] = mc.comb(r + c, r) - sum + MOD;
        dp[i] %= MOD;
    }
    PUTS(dp[n + 1]);
}

Measured memory_bytes: 5120