#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
template <typename X> ostream& operator << (ostream& x,const vector<X>& v){for(ll i=0;i<v.size();++i) x<<v[i]<<" ";return x;}
template <typename X> ostream& operator << (ostream& x,const set<X>& v){for(auto it:v) x<<it<<" ";return x;}
template <typename X, typename Y> ostream& operator << (ostream& x, const pair<X,Y>& v) {x<<v.ff<<" "<<v.ss;return x;}
template <typename T, typename S> ostream& operator << (ostream& os, const map<T, S>& v) { for (auto it : v) os << it.first << "=>" << it.second << endl; return os; }
struct pair_hash {inline std::size_t operator()(const std::pair<ll, ll> & v) const {return v.first*31+v.second;}};
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define speed ios_base::sync_with_stdio(false);cin.tie(NULL)
#define pb push_back
#define fr first
#define sc second
#define prnt(m) for(auto it = m.begin() ; it != m.end() ; ++it){cout<<*it<<endl;}
#define tra(it,m) for(auto it=m.begin();it!=m.end();++it)
#define DBG(x) cout<<"# # #     "<<x<<'\n';
#define fri(i,s,n) for(long long i=s;i<n;i++)
#define mod 1000000007LL
#define mod2 998244353
#define vct2 vector<vector<ll>>
#define vct vector<ll>
#define pll pair<ll,ll>
#define rz(n) resize(n)
#define all(v) v.begin(),v.end()
#define mkp make_pair
#define arrin(a,n) for(ll i = 0; i < n ; i++){cin>>a[i];}
#define arrout(a,n) for(ll i = 0;i < n; i++){cout<<a[i]<<" ";}
#define ex(s) cout<<s<<endl,exit(0);
#define inf 2e18
#define five 100005;
#define six 1000005;
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
//___________________________________________________________________________________________________________________________________________________________
ll power(ll a,ll b,ll m)
{
   ll ans=1;
   while(b>0)
   {
       if(b%2)
       {
           ans=(ans*a)%m;
       }
       a=(a*a)%m;
       b=b/2;
   }
   return ans;
}
ll inverse(ll a,ll m)
{
       return (power(a,m-2,m));
}
const int N = 400005;
ll fct[N];
ll invf[N];
ll C(ll n,ll r)
{
       if(r>n){return 0;}
       ll xx = (invf[r]*invf[n-r])%mod;
       xx *= fct[n];
       return xx%mod;
}
void initialize()
{
       fct[0] = 1;
       invf[0] = 1;
       fri(i,1,N){
              fct[i] = (i*fct[i-1])%mod;
              invf[i] = inverse(fct[i],mod);
       }
}
ll f(pair<int,int> a,pair<int,int> b)
{
       return C(abs(a.fr-b.fr)+abs(a.sc-b.sc),abs(a.fr-b.fr));
}
ll dp[3003];
int main()
{
       initialize();
       int n,m;
       cin>>n>>m;
       int k;
       cin>>k;
       pair<int,int> a[k];
       pair<int,int> lst = {n,m};
       fri(i,0,k){
              cin>>a[i].fr>>a[i].sc;
       }
       sort(a,a+k);
       memset(dp,0,sizeof dp);
       dp[k-1] = f(a[k-1],lst);
       for(int i = k-2 ; i >= 0 ; i--){
              dp[i] = f(a[i],lst);
              fri(j,i+1,k){
                     if(a[j].sc>=a[i].sc){
                            ll xx = (f(a[i],a[j])*dp[j])%mod;
                            dp[i] += (mod-xx)%mod;
                            dp[i] %= mod;
                     }
              }
       }
       ll answ = f(mkp(1,1),lst);

       fri(i,0,k){
              dp[i] *= f(mkp(1,1),a[i]);
              dp[i] %= mod;
              answ += (mod-dp[i])%mod;
              answ %= mod;
        }
        cout<<answ<<endl;
}


Measured memory_bytes: 6528