//-------All power is within you,you can do Anything and Everything.---------//
 
    #include <bits/stdc++.h>
    using namespace std;
  
//*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ M $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*//
 
    #define pb push_back
    #define MP make_pair
    #define F first
    #define S second
    #define int long long
    #define ld long double
    #define ss(x) scanf("%s",&x)
    #define sc(x) scanf("%c",&x)
    #define sd(x) scanf("%Lf",&x)
    #define si(x) scanf("%lld",&x)
    #define ps(x) printf("%s\n",x)
    #define pc(x) printf("%c\n",x)
    #define pd(x) printf("%Lf\n",x)
    #define pi(x) printf("%lld\n",x)
    #define all(x) x.begin(),x.end() 
    #define rall(x) x.rbegin(),x.rend()
    #define fo(i,a,b) for(int i=a;i<b;i++)
    #define rfo(i,b,a) for(int i=b;i>=a;i--)
    #define mem( a, val ) memset(a, val, sizeof( a ) )
    #define deci( x ) cout<<fixed<<setprecision( x );
    #define bitcount( x ) __builtin_popcountll( x )
    #define endl "\n" 
    
    #define XOX 
    
    typedef vector<int> vi;
    typedef pair<int,int> pi; 
    
    const int INF = 1e15;
    const int MAX = 2e6 + 7;
    const int MOD =  1000000007;
    const long double PI  =3.141592653589793238463;
    const int dx[8] = {-1, -1, -1, 0, 1, 1, 1, 0};
    const int dy[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
    
//*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ DEB $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*//
    
    #define deb(x) cout<<#x<<" "<<x<<endl;


    vector<string> vec_splitter(string s) 
    {
        for(char& c: s) c = c == ','?  ' ': c;
        stringstream ss; ss << s;
        vector<string> res;
        for(string z; ss >> z; res.push_back(z));
        return res;
    }
    void debug_out(vector<string> args, int idx) { cerr << endl; }
    template <typename Head, typename... Tail>
    void debug_out(vector<string> args, int idx, Head H, Tail... T) 
    {
        if(idx > 0) cerr << ", ";
        stringstream ss; ss << H;
        cerr << args[idx] << " = " << ss.str();
        debug_out(args, idx + 1, T...);
    }
    
    #ifdef XOX
    #define debug(...) debug_out(vec_splitter(#__VA_ARGS__), 0, __VA_ARGS__)
    #else
    #define debug(...) 42
    #endif

//*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ V $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*//  
    
    int i,j,k,t,n,q,l,r,mid;

//*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ F $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*//


            
    int F[MAX],inF[MAX];
    int mul(int a,int b)
    {
        return ((a%MOD)*(b%MOD))%MOD;
    }
    int add(int a,int b)
    {
        return ((a%MOD)+(b%MOD))%MOD;
    }
    int power(int a,int b)
    {
        int res = 1;
        while(b>0)
        {
            if(b&1)
            {
                res = mul(res,a);
            }
            b = b/2;
            a = mul(a,a);
        }
        return res;
    }
    int sub(int a,int b)
    {
        return ((a%MOD)-(b%MOD)+MOD)%MOD;
    }
    int divi(int a,int b)
    {
        return mul(a,power(b,MOD-2));
    }
    
    void fac(int n)
    {
        F[0]=1;
        fo(i,1,n+1)
        F[i]=mul(F[i-1],i);
    }
    
    void invf(int n)
    {
        inF[0]=1;
        fo(i,1,n+1)
        inF[i]=mul(inF[i-1],power(i,MOD-2));
    
    }
    
    void init()
    {
        F[0]=1;
        fo(i,1,MAX)
        F[i]=mul(i,F[i-1]);
    
        inF[MAX-1]=power(F[MAX-1],MOD-2);
        rfo(i,MAX-1,1)
        inF[i-1]=mul(i,inF[i]);
    }
    
    
    int ncr(int n,int r)
    {
        if(n<r||r<0)return 0;
    
        return mul(F[n],mul(inF[r],inF[n-r]));
    }
    
    bool cmp(const pi a,const pi b)
    {
        return (a.F+a.S)<(b.F+b.S);
    }
    int gbg(int a,int b)
    {
        return ncr(a+b,b);
    }

    int dpd[MAX];
    int temp,h,w,x,y;
    vector<pi> v;

    void solve()
    {
        init();
        cin>>w>>h>>n;
        fo(i,0,n)
        {
            cin>>x>>y;
            v.pb({x,y});
        }
        sort(all(v),cmp);       
        v.pb({w,h});

        temp=0;
        fo(i,0,n+1)
        {
            temp=gbg(v[i].F-1,v[i].S-1);
            fo(j,0,i)
            if(v[j].F<=v[i].F && v[j].S<=v[i].S)
            {
                temp=sub(temp,mul(dpd[j],gbg(-v[j].F+v[i].F,-v[j].S+v[i].S)));
            }
            dpd[i]=temp;
        }

        cout<<temp<<endl;

    }
    
//*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*//
//                          GAME STARTS FROM HERE                            //
 
    int32_t main() 
    {
    
        // int start,stop=clock();
        // cout<<"time:"<<(stop-start)/double(CLOCKS_PER_SEC)*1000<<endl;
        ios_base::sync_with_stdio(0);
        cin.tie(NULL);

        // sc(t);while(t--)
        // cin>>t;while(t--)
            solve();
    
        return 0;
    }

Measured memory_bytes: 33024