#include <bits/stdc++.h>
#define int             long long
#define ld              long double
#define pb              push_back
#define fo(i,n)         for(i=0;i<n;i++)
#define fo1(i,n)        for(int i=1;i<=n;i++)
#define fok(i,k,n)      for(int i=k;i<=n;i++)
#define rfo(i,n)        for(int i=n;i>=0;i--)
#define rfo1(i,n)       for(int i=n;i>0;i--)
#define all(c)          c.begin(),c.end()
#define rall(c)         c.rbegin(),c.rend()
#define si              set<int>
#define vi              vector<int>
#define mii             map<int,int>
#define pii             pair<int,int>
#define usi             unordered_set<int>
#define umii            unordered_map<int,int>
#define pqmx            priority_queue<int>
#define pqmn            priority_queue<int,vi,greater<int> >
#define sp(x,y)         fixed<<setprecision(y)<<x
#define setbits(x)      __builtin_popcount(x)
#define zerobits(x)     __builtin_ctz(x)
#define in(a,n)         vi a(n);fo(i,n)cin>>a[i];
#define in1(a,n)        vi a(n+1);fo1(i,n)cin>>a[i];
#define w(t)            int t;cin>>t;while(t--)
#define endl            '\n'
#define PI              3.14159265358979323846
#define mod             1000000007
#define inf             1e18
using namespace std;
void __p(int x) {cout<<x;}
void __p(float x){cout<<x;}
void __p(double x){cout<<x;}
void __p(ld x) {cout<<x;}
void __p(char x){cout <<'\''<<x<<'\'';}
void __p(const char *x){cout <<'\"' <<x<<'\"';}
void __p(const string &x) {cout<<'\"'<<x<<'\"';}
void __p(bool x) {cout<<(x?"true":"false");}
template<typename T,typename V>     void __p(const pair<T,V> &x) {cout<<'{';__p(x.first);cout<<',';__p(x.second);cout<<'}';}
template<typename T>                void __p(const T &x) {int f = 0; cout << '{'; for (auto &i: x) cout << (f++ ? "," : ""), __p(i); cout << "}";}void _p() {cout << "]\n";}
template <typename T,typename... V> void _p(T t, V... v) {__p(t);if(sizeof...(v))cout<<", ";_p(v...);}
#ifndef ONLINE_JUDGE
#define dbg(x...) cout<<"["<<#x<<"]=[";_p(x)
#else 
#define dbg(x...)
#endif


const int N=2e5+1;
int n,m,k,x,y,z,a1,b,c,d,i,j,l,r;

int fact[N];
int inv[N];



int power(int x,int p)
{
    int ans=1;
    while (p>0)
    {
        if(p&1)ans=(ans*x)%mod;
        x=(x*x)%mod;
        p=p>>1; 
    }
    return ans;
}



int inverse(int x)
{
    return power(x,mod-2)%mod;
}



void preprocess()
{
   fact[0]=inv[0]=1;
   fo1(i,N-1)
   {
       fact[i]=(fact[i-1]*i)%mod;
       inv[i]=inverse(fact[i]);
   }

}

int nCr(int n,int r)
{
    return (fact[n]*inv[r]%mod*inv[n-r]%mod)%mod;
}


bool cmp(pii a,pii b)
{
    return a.first+a.second<b.first+b.second;
}

int path_point(pii a,pii b)
{  if(a.first<=b.first && a.second<=b.second )
    {int d=b.first-a.first;
    int r=b.second-a.second;
    return nCr(r+d,d);
    }
    return 0;
}


void sol()
{   int h,w;
    preprocess();
    cin>>h>>w>>n;
    vector<pii> obs(n);
    fo(i,n)
    {
        cin>>obs[i].first>>obs[i].second;
    }
    sort(all(obs),cmp);
    vi path_obs;
    path_obs.pb(path_point({1,1},obs[0]));
    
    for( int i=1;i<n;i++)
    {   int path=path_point({1,1},obs[i]);
        for( int j=i-1;j>=0;j--)
        {
            path=(path-(path_obs[j]*path_point(obs[j],obs[i]))%mod+mod)%mod;
        }
        path_obs.pb(path);
    }
    
    int ans=path_point({1,1},{h,w});
    fo(i,n)
    {
        ans=(ans+mod-(path_obs[i]*path_point(obs[i],{h,w}))%mod)%mod;
    }
    
    cout<< ans <<endl;
}





int32_t main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    // w(t)
    sol();
    return 0;
}

Measured memory_bytes: 3456