#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ull,ull> pull;
#define mod 1000000007
#define sci(n) scanf("%d",&n)
#define scli(n) scanf("%I32d",&n)
#define sclli(n) scanf("%I64d",&n)
#define pfi(n) printf("%d",n)
#define pfli(n) printf("%I32d",n)
#define pflli(n) printf("%I64d",n)
#define rep(i,a,b) for(int i=(int)(a);i<=(int)(b);i++)
#define reprev(i,a,b) for(int i=(int)(a);i>=(int)(b);i--)
#define mp make_pair
#define f first
#define s second
#define sync ios_base::sync_with_stdio(false)
vector<pll> bl;
ll fact[200005];
ll ifact[200005];
long long invert_mod(long long a,long long p) {
long long n = 1, old = 0, q = p, r, h;
bool pos = false;
while (a > 0) {
r = q%a;
q = q/a;
h = q*n + old;
old = n;
n = h;
q = a;
a = r;
pos = !pos;
}
return pos ? old : (p - old);
}
void calc_fact()
{
fact[0]=fact[1]=1;
ifact[0]=ifact[1]=1;
for(ll i=2;i<200005;i++)
{ fact[i] = (i*fact[i-1])%mod;
ifact[i] = invert_mod(fact[i],mod);//*ifact[i-1];
}
}
int main(void)
{ sync;
//cout<<"hi";
ll h,w,n;
cin>>h>>w>>n;
calc_fact();
bl.resize(n);
for(int i=0;i<n;i++)
{
cin>>bl[i].f>>bl[i].s;
}
bl.push_back(mp(h,w));
vector <ll> dp(n+1,0);
sort(bl.begin(),bl.end());
dp[0] = ((fact[bl[0].f + bl[0].s-2]*ifact[bl[0].f-1])%mod*ifact[bl[0].s-1])%mod;
//cout<<dp[0]<<"\n";
// ull ans = 0;
for(int i=1;i<=n;i++)
{
//ll x = bl[i].f,y=bl[i].s;
dp[i] = ((fact[bl[i].f + bl[i].s-2]*ifact[bl[i].f-1])%mod*ifact[bl[i].s-1])%mod;
//cout<<dp[i]<<"\n";
ll ans=0;
for(int j=0;j<i;j++)
{ //int j = i-1;
ll val = ( ( fact[(bl[i].f + bl[i].s)-(bl[j].f+bl[j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IwMDAwNV07Cgpsb25nIGxvbmcgaW52ZXJ0X21vZChsb25nIGxvbmcgYSxsb25nIGxvbmcgcCkgewogICAgbG9uZyBsb25nIG4gPSAxLCBvbGQgPSAwLCBxID0gcCwgciwgaDsKICAgIGJvb2wgcG9zID0gZmFsc2U7CiAgICB3aGlsZSAoYSA+IDApIHsKICAgICAgICByID0gcSVhOwogICAgICAgIHEgPSBxL2E7CiAgICAgICAgaCA9IHEqbiArIG9sZDsKICAgICAgICBvbGQgPSBuOwogICAgICAgIG4gPSBoOwogICAgICAgIHEgPSBhOwogICAgICAgIGEgPSByOwogICAgICAgIHBvcyA9ICFwb3M7CiAgICB9CiAgICByZXR1cm4gcG9zID8gb2xkIDogKHAgLSBvbGQpOwp9CnZvaWQgY2FsY19mYWN0KCkKewogICAgZmFjdFswXT1mYWN0WzFdPTE7CiAgICBpZmFjdFswXT1pZmFjdFsxXT0xOwogICAgZm9yKGxsIGk9MjtpPDIwMDAwNTtpKyspCiAgICAgICB7IGZhY3RbaV0gPSAoaSpmYWN0W2ktMV0pJW1vZDsKICAgICAgICAgaWZhY3RbaV0gPSBpbnZlcnRfbW9kKGZhY3RbaV0sbW9kKTsvLyppZmFjdFtpLTFdOwogICAgICAgIH0KfQppbnQgbWFpbih2b2lkKQp7ICAgc3luYzsKICAgIC8vY291dDw8ImhpIjsKICAgIGxsIGgsdyxuOwogICAgY2luPj5oPj53Pj5uOwogICAgY2FsY19mYWN0KCk7CiAgICBibC5yZXNpemUobik7CiAgICBmb3IoaW50IGk9MDtpPG47aSsrKQogICAgewogICAgICAgIGNpbj4+YmxbaV0uZj4+YmxbaV0uczsKICAgIH0KICAgIGJsLnB1c2hfYmFjayhtcChoLHcpKTsKICAgIHZlY3RvciA8bGw+IGRwKG4rMSwwKTsKICAgIHNvcnQoYmwuYmVnaW4oKSxibC5lbmQoKSk7CiAgICBkcFswXSA9ICgoZmFjdFtibFswXS5mICsgYmxbMF0ucy0yXSppZmFjdFtibFswXS5mLTFdKSVtb2QqaWZhY3RbYmxbMF0ucy0xXSklbW9kOwogICAgLy9jb3V0PDxkcFswXTw8IlxuIjsKICAgLy8gdWxsIGFucyA9IDA7CiAgICBmb3IoaW50IGk9MTtpPD1uO2krKykKICAgICAgICB7CiAgICAgICAgICAgIC8vbGwgeCA9IGJsW2ldLmYseT1ibFtpXS5zOwogICAgICAgICAgICBkcFtpXSA9ICgoZmFjdFtibFtpXS5mICsgYmxbaV0ucy0yXSppZmFjdFtibFtpXS5mLTFdKSVtb2QqaWZhY3RbYmxbaV0ucy0xXSklbW9kOwogICAgICAgICAgICAvL2NvdXQ8PGRwW2ldPDwiXG4iOwoKICAgICAgICAgICAgbGwgYW5zPTA7CiAgICAgICAgICAgIGZvcihpbnQgaj0wO2o8aTtqKyspCiAgICAgICAgICAgIHsgICAgLy9pbnQgaiA9IGktMTsKICAgICAgICAgICAgICAgbGwgdmFsID0gKCAoIGZhY3RbKGJsW2ldLmYgKyBibFtpXS5zKS0oYmxbal0uZitibFtqXS5zKV0qaWZhY3RbYmxbaV0uZi1ibFtqXS5mXSklbW9kICppZmFjdFtibFtpXS5zLWJsW2pdLnNdKSVtb2Q7CiAgICAgICAgICAgICAgICBhbnMgPSAoYW5zICsgKGRwW2pdKnZhbCklbW9kKSVtb2Q7CiAgICAgICAgICAgIC8vICAgIGNvdXQ8PCJWYWw6ICI8PHZhbDw8IkFuczogIjw8YW5zPDwiXG4iOwogICAgICAgICAgICAgICAgLy9hbnMgPSAgKGFucyArKCApJW1vZDsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgZHBbaV0gPSAoIGRwW2ldICsgKG1vZCAtIGFucykpJW1vZDsKICAgICAgICAgICAgLy9jb3V0PDxkcFtpXTw8IlxuIjsKICAgICAgICB9CiAgICAgICAgY291dDw8ZHBbbl07CiAgICByZXR1cm4gMDsKfQo=