#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;

#define inf 1013161010
#define mod 1000000007
#define ll long long
#define lf long double
#define sz(x) ((int)x.size())
#define rep(i,n) for(i=0;i<n;i++)
#define rep1(i,a,b) for(i=a;i<=b;i++)
#define fr freopen("x.txt","r",stdin)
#define frc freopen("y.txt","w",stdout)
#define all(x) x.begin(),x.end()
#define set0(x) memset(x,0,sizeof(x))
#define dbg cout<<"yo "<<endl;
#define pset(n) fixed<<showpoint<<setprecision(n)

#define pii pair<int,int>
#define pll pair<ll,ll>
#define min_pq priority_queue<pll, vector<pll>, greater<pll> >
#define vpii vector<pair<int,int> >
#define vll vector<ll>
#define vpll vector<pair<ll,ll> >
#define si set<int>
#define mii map<int,int>
#define umii unordered_map<int,int>
#define vi vector<int>
#define pb push_back
#define ff first
#define ss second
#define mp make_pair

typedef tree<pii,null_type,less<pii>,rb_tree_tag,tree_order_statistics_node_update> OST;

ll toint(const string &s) { stringstream ss; ss << s; ll x; ss >> x; return x; }
ll add(ll a, ll b) {a+=b; while(a >= mod) a-= mod; while(a<0) a+= mod;}
ll mul(ll a, ll b) {return (a * 1LL *b % mod);}
string tostring ( ll number ){  stringstream ss; ss<< number; return ss.str();}

const lf pi = 2*acos(0);
const int nn = 210006;
const lf EPS = 0.000000001;

ll gcd(ll a,ll b){return (b==0)? a:gcd(b,a%b); }
void nope(int num = 0){ if(num==0) cout<<"NO"; else cout<<"-1"; exit(0); }
ll fast_pow(ll a,ll m, ll mode) { if(m==0) return 1; else if(m==1) return a; ll h=fast_pow(a,m/2,mode); if(m%2==0) return ((h*h)%mode); else return ((((h*h)%mode)*a)%mode);}
ll mmi(ll b, ll mode){return fast_pow(b, mode-2, mode);}

vll g[3010], c[3010];
ll x[3010], y[3010];
ll cnt[3010], val[3010], factorial[nn], mf[nn];

ll ncr(ll a, ll b)
{
    ll n = a + b;
    ll ans = factorial[n];
    ans = ans * mf[a];
    ans %= mod;
    ans = ans * mf[b];
    ans %= mod;
    return ans;
}

int main()
{
    ios_base::sync_with_stdio(false); cin.tie(0);
    ll i,j,n,tt;
    tt=1;
    //cin>>tt;
    while(tt--)
    {
        factorial[0] = 1;
        for(i=1;i<=200505;i++)
            factorial[i] = (factorial[i - 1] * i ) % mod;
        mf[0] = 1LL;
        for(i=1; i<=200500; i++)
            mf[i] = mmi(factorial[i], mod);

        ll h, w;
        cin>>h>>w>>n;
        rep(i, n)
        {
            cin>>x[i]>>y[i];
            x[i]--;
            y[i]--;
        }

        for(i=0;i<n;i++)
        {
            for(j=0;j<n;j++)
            {
                if(i == j)
                    continue;
                if(x[j] >= x[i] and y[j] >= y[i])
                {
                    cnt[j]++;
                    g[j].pb(i);
                    c[i].pb(j);
                }
            }
        }

        queue<ll>q;
        for(i=0; i<n; i++)
            if(cnt[i] == 0)
                q.push(i);

        while(!q.empty())
        {
            ll top = q.front();
            q.pop();
            ll res = ncr(x[top], y[top]);
            for(auto u : c[top])
            {
                cnt[u]--;
                if(cnt[u] == 0)
                    q.push(u);
            }
            for(auto u : g[top])
            {
                ll deduct = val[u] * ncr(x[top] - x[u], y[top] - y[u]);
                deduct %= mod;
                res = (res - deduct + mod) % mod;
            }
            val[top] = res;
        }

        ll ans;
        ans = ncr(h-1, w-1);
        for(int i = 0; i < n; i++)
        {
            ll deduct = (val[i] * ncr(h-1LL-x[i], w-1LL-y[i])) % mod;
            ans = ans - deduct + mod;
            ans %= mod;
        }
        cout<<ans<<endl;

    }
    return 0;
}

// read the question correctly (is y a vowel? what are the exact constraints?)
// look out for SPECIAL CASES (n=1?) and overflow (ll vs int?)


Measured memory_bytes: 94848