stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <iostream>

#include <cmath>

#include <algorithm>

#include <cstdio>

#include <cstring>

typedef long long ll;

#define rep(i,s,t) for (ll i = s ; i < t ; ++ i)

#define mod 1000000007

#define maxn 200005



using namespace std;



ll fac[maxn],inv[maxn];



int f(ll a,ll b)

{

    ll ans = 1;

    while (b)

    {

        if (b%2)

           ans = ans * a % mod;

        a = a * a % mod;

        b /= 2;

    }

    return ans;

}



void init()

{

    fac[0] = 1;

    rep(i,1,maxn)

       fac[i] = fac[i-1] * i % mod;

    inv[maxn-1] = f(fac[maxn-1],mod-2);

    for (ll i = maxn-2 ; i >=0 ; -- i)

        inv[i] = inv[i+1] * (i+1) % mod;

}

int main()

{

    init();

    int h,w,a,b;

    cin>> h >> w >> a >> b;

    ll ans = 0;

    for (int i = b + 1 ; i <= w ; i++)

    {

        int sum = h - a + i - 2 ;

        ll cmp1 = fac[sum] * inv[i - 1] % mod;

        cmp1 = cmp1 * inv[h-a-1] % mod;



        sum = a + w - i - 1;

        ll cmp2 = fac[sum] * inv[a - 1] % mod;

        cmp2 = cmp2 * inv[w-i] % mod;



        cmp1 = cmp1 * cmp2 % mod;

        ans = (ans + cmp1) % mod;

    }

    cout<< ans <<endl;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.3363715229017725x):
#include <cstdio>

#include <iostream>

#include <cstring>

using namespace std;

#define LL long long



int h,w,a,b;

int mo = 1e9 + 7;



LL dp[1005][1005];

LL Line[100005];

LL F[200005];



LL expo( LL a , LL b ){

	if ( b == 0 ) return 1;

	if ( b == 1 ) return a;

	LL half = expo(a,b/2);

	half = (1LL * half * half ) % mo;

	if (b & 1 ) half = ( 1LL * half * a ) % mo;

	return half;

}



LL C( int n, int k ){

	LL ans = F[n];

	LL d1 = expo(F[n-k],mo-2), d2 = expo(F[k],mo-2);

	ans = ( 1LL * ans * d1 ) % mo;

	ans = ( 1LL * ans * d2 ) % mo;

	return ans; 

}



int main(){



	F[0] = 1;

	for ( int i = 1; i <= 200000; i++ ){

		F[i] = ( 1LL * F[i-1] * i ) % mo;

	}



	scanf("%d%d%d%d",&h,&w,&a,&b);

	// dp[1][0] = 1;

	// for ( int i = 1; i <= h; i++ ){

	// 	for ( int j = 1; j <= w; j++ ){

	// 		if ( j <= b && i >= h-a+1 ) continue;

	// 		dp[i][j] = dp[i-1][j] + dp[i][j-1];

	// 		cout << dp[i][j] << " ";

	// 	}

	// 	cout << endl;

	// }

	

	for ( int i = b+1; i <= w ; i++ ){

		Line[i] = C((h-a) + (i) - 2, i - 1);

	}

	LL sum = 0;

	for ( int i = b+1; i <= w; i++ ){

		// cout << i-b << " " << C(a-2 + i - b , i - b - 1) << endl;

		sum = ( sum + ( ( 1LL * C(a-2 + i - b, i - b - 1) * Line[w - ( i - b ) + 1] ) % mo ) ) % mo;

	}

	printf("%lld\n",sum);

	return 0;

}
// Slower C++ solution:
#include <iostream>

#include <cstring>

#include <cstdio>

#include <algorithm>

#include <cmath>

using namespace std;

#define ll long long

#define maxn 210000

#define mod 1000000007

const int m=1e9+7;

ll gcd(ll p,ll q){return q==0?p:gcd(q,p%q);}

ll qpow(ll p,ll q){ll f=1;while(q){if(q&1)f=f*p%mod;p=p*p%mod;q>>=1;}return f;}

int n,k,t,h,w,a,b;

ll fac[maxn],inv[maxn];

void init()

{

    fac[0]=1;

    for(int i=1;i<=maxn-10;i++)fac[i]=fac[i-1]*i%mod;

    inv[maxn-10]=qpow(fac[maxn-10],mod-2);

    for(int i=maxn-11;i>=0;i--)inv[i]=inv[i+1]*(i+1)%mod;

}

ll C(int x,int y)

{

    return fac[x]*inv[y]%mod*inv[x-y]%mod;

}

int main()

{

    //freopen("de.txt","r",stdin);

    init();

    while (~scanf("%d%d%d%d",&h,&w,&a,&b)){

        ll ans=C(h+w-2,h-1);

        for (int i=0;i<b;++i){

            ll temp1=C(i+h-1-a,i);

            ll temp2=C(w-i+a-2,a-1);

            ll temp3=(temp1*temp2)%mod;

            ans=(ans-temp3+mod)%mod;

        }

        printf("%I64d\n",ans);

    }

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.3858883190446691x):
#include <cstdio>

#include <iostream>

#include <cstring>

using namespace std;

#define LL long long



int h,w,a,b;

int mo = 1e9 + 7;



LL dp[1005][1005];

LL Line[100005];

LL F[200005];



LL expo( LL a , LL b ){

	if ( b == 0 ) return 1;

	if ( b == 1 ) return a;

	LL half = expo(a,b/2);

	half = (1LL * half * half ) % mo;

	if (b & 1 ) half = ( 1LL * half * a ) % mo;

	return half;

}



LL C( int n, int k ){

	LL ans = F[n];

	LL d1 = expo(F[n-k],mo-2), d2 = expo(F[k],mo-2);

	ans = ( 1LL * ans * d1 ) % mo;

	ans = ( 1LL * ans * d2 ) % mo;

	return ans; 

}



int main(){



	F[0] = 1;

	for ( int i = 1; i <= 200000; i++ ){

		F[i] = ( 1LL * F[i-1] * i ) % mo;

	}



	scanf("%d%d%d%d",&h,&w,&a,&b);

	// dp[1][0] = 1;

	// for ( int i = 1; i <= h; i++ ){

	// 	for ( int j = 1; j <= w; j++ ){

	// 		if ( j <= b && i >= h-a+1 ) continue;

	// 		dp[i][j] = dp[i-1][j] + dp[i][j-1];

	// 		cout << dp[i][j] << " ";

	// 	}

	// 	cout << endl;

	// }

	

	for ( int i = b+1; i <= w ; i++ ){

		Line[i] = C((h-a) + (i) - 2, i - 1);

	}

	LL sum = 0;

	for ( int i = b+1; i <= w; i++ ){

		// cout << i-b << " " << C(a-2 + i - b , i - b - 1) << endl;

		sum = ( sum + ( ( 1LL * C(a-2 + i - b, i - b - 1) * Line[w - ( i - b ) + 1] ) % mo ) ) % mo;

	}

	printf("%lld\n",sum);

	return 0;

}
// Slower C++ solution:
#include<iostream>

using namespace std;

#define int long long

#define MOD (long long)(1e9+7)

#define MAX_VAL (long long)(1e5*2+100)



long long fac[MAX_VAL], mmi[MAX_VAL], temp[MAX_VAL];



void factorial(){

	fac[0] = fac[1] = 1;

	for(long long i = 2; i < MAX_VAL; fac[i]%=MOD,i++)

		fac[i] = fac[i-1]*(i%MOD);

}





long long power_mod(long long x, long long n){

	long long ans = 1;

	for(;n;n>>=1,x*=x,ans%=MOD,x%=MOD)

		if(n&1)ans*=x;

	return ans%MOD;

}



void modular_multiplicatibe_inverse(){

	mmi[MAX_VAL-1] = power_mod(fac[MAX_VAL-1],MOD-2);

	for(long long i = MAX_VAL-2; i >= 0; mmi[i]%=MOD,i--)

		mmi[i] = mmi[i+1]*((i+1)%MOD);

}



long long combination(long long n, long long r){

	return fac[n]*(mmi[r]*mmi[n-r]%MOD)%MOD;

}



signed main(){

	int H, W, A, B, ans = 0;

	cin>>H>>W>>A>>B;

	factorial();

	modular_multiplicatibe_inverse();



	for(int i = B+1; i <= W; ans%=MOD,i++)

		ans += combination(i+H-A-2,H-A-1)*combination(A+W-i-1,W-i)%MOD;

	

	cout<<ans<<endl;



}

// Faster C++ solution for the same problem (measured speedup: 4.221976646751288x):
#include<iostream>

using namespace std;

#define int long long

#define MOD (long long)(1e9+7)

#define MAX_V (long long)(1e5*2+200)



long long MAX_VAL, MAX_VAL2;

long long fac[MAX_V], mmi[MAX_V], temp[MAX_V];



inline void factorial(){

	fac[0] = fac[1] = 1;

	for(long long i = 2; i < MAX_VAL; fac[i]%=MOD,i++)

		fac[i] = fac[i-1]*(i%MOD);

}



inline long long power_mod(long long x, long long n){

	long long ans = 1;

	for(;n;n>>=1,x*=x,ans%=MOD,x%=MOD)

		if(n&1)ans*=x;

	return ans%MOD;

}



inline void modular_multiplicatibe_inverse(){

	mmi[MAX_VAL2-1] = power_mod(fac[MAX_VAL2-1],MOD-2);

	for(long long i = MAX_VAL2-2; i >= 0; mmi[i]%=MOD,i--)

		mmi[i] = mmi[i+1]*((i+1)%MOD);

}



inline long long combination(long long n, long long r){

	return fac[n]*(mmi[r]*mmi[n-r]%MOD)%MOD;

}



signed main(){

	int H, W, A, B, ans = 0;

	cin>>H>>W>>A>>B;

	MAX_VAL = max(W+H-A-2,A+W-1)+30;

	MAX_VAL2 = max(max(W-B+1,W-1),max(H-A-1, A-1))+10;

	

	factorial();

	modular_multiplicatibe_inverse();



	for(int i = B+1; i <= W; ans%=MOD,i++)

		ans += combination(H-A+i-2,H-A-1)*combination(W+A-i-1,A-1)%MOD;

	cout<<ans<<endl;



}
// Slower C++ solution:
#include<iostream>

using namespace std;

#define int long long

#define MOD (long long)(1e9+7)

#define MAX_VAL (long long)(1e5*2+100)



long long fac[MAX_VAL], mmi[MAX_VAL], temp[MAX_VAL];



void factorial(){

	fac[0] = fac[1] = 1;

	for(long long i = 2; i < MAX_VAL; fac[i]%=MOD,i++)

		fac[i] = fac[i-1]*(i%MOD);

}





long long power_mod(long long x, long long n){

	long long ans = 1;

	for(;n;n>>=1,x*=x,ans%=MOD,x%=MOD)

		if(n&1)ans*=x;

	return ans%MOD;

}



void modular_multiplicatibe_inverse(){

	mmi[MAX_VAL-1] = power_mod(fac[MAX_VAL-1],MOD-2);

	for(long long i = MAX_VAL-2; i >= 0; mmi[i]%=MOD,i--)

		mmi[i] = mmi[i+1]*((i+1)%MOD);

}



long long combination(long long n, long long r){

	return fac[n]*(mmi[r]*mmi[n-r]%MOD)%MOD;

}



signed main(){

	int H, W, A, B, ans = 0;

	cin>>H>>W>>A>>B;

	factorial();

	modular_multiplicatibe_inverse();



	for(int i = B+1; i <= W; ans%=MOD,i++)

		ans += combination(i+H-A-2,H-A-1)*combination(A+W-i-1,W-i)%MOD;

	

	cout<<ans<<endl;



}

// Faster C++ solution for the same problem (measured speedup: 4.224046961016874x):
#include<iostream>

using namespace std;

#define int long long

#define MOD (long long)(1e9+7)

#define MAX_V (long long)(1e5*2+200)



long long MAX_VAL, MAX_VAL2;

long long fac[MAX_V], mmi[MAX_V], temp[MAX_V];



inline void factorial(){

	fac[0] = fac[1] = 1;

	for(long long i = 2; i < MAX_VAL; fac[i]%=MOD,i++)

		fac[i] = fac[i-1]*(i%MOD);

}



inline long long power_mod(long long x, long long n){

	long long ans = 1;

	for(;n;n>>=1,x*=x,ans%=MOD,x%=MOD)

		if(n&1)ans*=x;

	return ans;

}



inline void modular_multiplicatibe_inverse(){

	mmi[MAX_VAL2-1] = power_mod(fac[MAX_VAL2-1],MOD-2);

	for(long long i = MAX_VAL2-2; i >= 0; mmi[i]%=MOD,i--)

		mmi[i] = mmi[i+1]*(i+1);

}



inline long long combination(long long n, long long r){

	return fac[n]*(mmi[r]*mmi[n-r]%MOD)%MOD;

}



inline long long foo(long long n, long long r){

}

signed main(){

	int H, W, A, B, ans = 0;

	cin>>H>>W>>A>>B;

	MAX_VAL = max(W+H-A-2,A+W-1)+5;

	MAX_VAL2 = max(max(W-B+1,W-1),max(H-A-1, A-1))+3;

	

	factorial();

	modular_multiplicatibe_inverse();



	for(int i = B+1; i <= W; ans%=MOD,i++)

		ans += combination(H-A+i-2,H-A-1)*combination(W+A-i-1,A-1);

	cout<<ans<<endl;



}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



typedef pair<int,int> ii;

#define fi first

#define se second



const int N = 2e5 + 5;

const int MOD = 1e9 + 7;



int h, w, a, b;

int fac[N], ifac[N];



int fpow(int x,int y) {

	int ret = 1;

	while (y) {

		if (y & 1) ret = 1LL * ret * x % MOD;

		x = 1LL * x * x % MOD;

		y >>= 1;

	}

	return ret;

}



int C(int n,int k) {

	if (n < k || k < 0) return 0;

	int ret = 1LL * ifac[k] * ifac[n - k] % MOD;

	ret = 1LL * ret * fac[n] % MOD;

	return ret; 

}



int main() {

	ios_base::sync_with_stdio(false);

	fac[0] = 1; for (int i = 1; i < N; ++i) fac[i] = 1LL * fac[i - 1] * i % MOD;

	ifac[N - 1] = fpow(fac[N - 1], MOD - 2);

	for (int i = N - 2; i >= 0; --i) ifac[i] = 1LL * ifac[i + 1] * (i + 1) % MOD;

	cin >> h >> w >> a >> b;

	int res = 0;

	for (int i = 1; i <= h - a; ++i) {

		int j = b + 1;

		int add;

		if (i == h - a) add = 1LL * C(i + j - 2, i - 1) * C(h - i + w - j, h - i) % MOD;

		else add = 1LL * C(i + j - 2, i - 1) * C(h - i + w - j - 1, w - j - 1) % MOD; 

		res += add; if (res >= MOD) res -= MOD;

	}

	cout << res;

}

// Faster C++ solution for the same problem (measured speedup: 3.1669364622346348x):
#include<bits/stdc++.h>

using namespace std;



#define int long long

const int MOD = 1e9 + 7;

int f[200001], c[200001];



int binpw(int ba, int exp){

    int ans = 1;

	while(exp != 0){

	    if(exp % 2 != 0) ans *= ba;

	    ans %= MOD;

	    ba = ba * ba % MOD;

	    exp /= 2;

	}

	return ans;

}



int C(int a, int b){

	int ans = (c[a + b] * f[a]) % MOD;

	return (ans * f[b]) % MOD;

}



signed main()

{

	int h, w, a, b;

	cin >> h >> w >> a >> b;

	f[0] = c[0] = 1;

	for(int i = 1; i <= h + w; i++){

		c[i] = (c[i - 1] * i) % MOD;

		f[i] = binpw(c[i], MOD - 2);

	}

	int ans = 0;

	for(int i = b + 1; i <= w; i++){

		ans += C(h - a - 1, i - 1) * C(a - 1, (w - i));

		ans %= MOD;

	}

	cout << ans;

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



typedef pair<int,int> ii;

#define fi first

#define se second



const int N = 2e5 + 5;

const int MOD = 1e9 + 7;



int h, w, a, b;

int fac[N], ifac[N];



int fpow(int x,int y) {

	int ret = 1;

	while (y) {

		if (y & 1) ret = 1LL * ret * x % MOD;

		x = 1LL * x * x % MOD;

		y >>= 1;

	}

	return ret;

}



int C(int n,int k) {

	if (n < k || k < 0) return 0;

	int ret = 1LL * ifac[k] * ifac[n - k] % MOD;

	ret = 1LL * ret * fac[n] % MOD;

	return ret; 

}



int main() {

	ios_base::sync_with_stdio(false);

	fac[0] = 1; for (int i = 1; i < N; ++i) fac[i] = 1LL * fac[i - 1] * i % MOD;

	ifac[N - 1] = fpow(fac[N - 1], MOD - 2);

	for (int i = N - 2; i >= 0; --i) ifac[i] = 1LL * ifac[i + 1] * (i + 1) % MOD;

	cin >> h >> w >> a >> b;

	int res = 0;

	for (int i = 1; i <= h - a; ++i) {

		int j = b + 1;

		int add;

		if (i == h - a) add = 1LL * C(i + j - 2, i - 1) * C(h - i + w - j, h - i) % MOD;

		else add = 1LL * C(i + j - 2, i - 1) * C(h - i + w - j - 1, w - j - 1) % MOD; 

		res += add; if (res >= MOD) res -= MOD;

	}

	cout << res;

}

// Faster C++ solution for the same problem (measured speedup: 1.2083447667210026x):
#include <bits/stdc++.h>

#define MOD 1000000007

#define pb push_back

#define int long long

#define bw(i,r,l) for (int i=r-1;i>=l;i--)

#define fw(i,l,r) for (int i=l;i<r;i++)

#define fa(i,x) for (auto i:x)

using namespace std;

const int N=2e5+5;

int h,w,a,b;

int fac[N+1];

struct math {

	int fpow(int a,int p,int mod) {

		if (!p) return 1;

		int ans=fpow(a,p>>1,mod); ans*=ans; ans%=mod;

		if (p&1) {ans*=a; ans%=mod;}

		return ans;

	}

	int inv(int a,int mod) {return fpow(a,mod-2,mod);}

	void preC(int n,int mod) {

		fac[0]=1;

		fw (i,1,n+1) fac[i]=fac[i-1]*i%mod;

	}

	int getC(int k,int n,int mod) {if (k<0) return 0; if (k>n) return 0; if (!k) return 1; return fac[n]*inv(fac[k]*fac[n-k]%mod,mod)%mod;}

} m;

int ans=0;

signed main() {

	//freopen("aome.inp","r",stdin);

	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

	cin>>h>>w>>a>>b;

	/*

	Use inclusion - exlusion, we will count number of invalid paths

	Invalid path: A path that will enter the forbidden area at some point

	Check through all first columns of the forbidden area, we can see a valid path always go from

	the spot right above it down to it. So we just count easily.

	*/

	m.preC(N,MOD);

	ans=m.getC(w-1,h+w-2,MOD);

	fw (i,1,b+1) {

		//cout<<"Reach: "<<m.getC(i-1,h-a+i-2,MOD)<<", to end: "<<m.getC(a-1,w-i+a-1,MOD)<<"\n";

		ans-=m.getC(i-1,h-a+i-2,MOD)*m.getC(a-1,w-i+a-1,MOD)%MOD;

		if (ans<0) ans+=MOD;

	}

	cout<<ans;

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



typedef pair<int,int> ii;

#define fi first

#define se second



const int N = 2e5 + 5;

const int MOD = 1e9 + 7;



int h, w, a, b;

int fac[N], ifac[N];



int fpow(int x,int y) {

	int ret = 1;

	while (y) {

		if (y & 1) ret = 1LL * ret * x % MOD;

		x = 1LL * x * x % MOD;

		y >>= 1;

	}

	return ret;

}



int C(int n,int k) {

	if (n < k || k < 0) return 0;

	int ret = 1LL * ifac[k] * ifac[n - k] % MOD;

	ret = 1LL * ret * fac[n] % MOD;

	return ret; 

}



int main() {

	ios_base::sync_with_stdio(false);

	fac[0] = 1; for (int i = 1; i < N; ++i) fac[i] = 1LL * fac[i - 1] * i % MOD;

	ifac[N - 1] = fpow(fac[N - 1], MOD - 2);

	for (int i = N - 2; i >= 0; --i) ifac[i] = 1LL * ifac[i + 1] * (i + 1) % MOD;

	cin >> h >> w >> a >> b;

	int res = 0;

	for (int i = 1; i <= h - a; ++i) {

		int j = b + 1;

		int add;

		if (i == h - a) add = 1LL * C(i + j - 2, i - 1) * C(h - i + w - j, h - i) % MOD;

		else add = 1LL * C(i + j - 2, i - 1) * C(h - i + w - j - 1, w - j - 1) % MOD; 

		res += add; if (res >= MOD) res -= MOD;

	}

	cout << res;

}

// Faster C++ solution for the same problem (measured speedup: 3.1669426633644036x):
#include<bits/stdc++.h>



using namespace std;



#define int long long



const int   N   = 2e5 + 1;

const int   mod = 1e9 + 7;



int qpow(int a,int exp) {

    int ans = 1;

    while(exp)  {

        if(exp & 1) ans = ans * a % mod;

        a = a * a % mod;  exp >>= 1;

    }

    return ans;

}



int F[N], I[N];

int h, w, a, b;



int combi(int n,int k)  {

    if(n < 0 || k < 0 || n < k) return 0;

    int ans = I[k] * I[n - k] % mod;

    return ans * F[n] % mod;

}

signed main()   {

    cin >> h >> w >> a >> b;



    F[0] = I[0] = 1;

    for(int i = 1 ; i <= h + w ; ++i)

        F[i] = F[i - 1] * i % mod;

    I[h + w] = qpow(F[h + w],mod - 2);

    for(int i = h + w - 1 ; i ; --i)

        I[i] = I[i + 1] * (i + 1) % mod;

    int ans = 0;

    for(int i = b + 1 ; i <= w ; ++i)

        ans = (ans + combi(i + h - a - 2,i - 1) * combi(w - i + a - 1,a - 1)) % mod;

    cout << ans << endl;

}
// Slower C++ solution:
#include <bits/stdc++.h>

#define MOD 1000000007

#define pb push_back

#define int long long

#define bw(i,r,l) for (int i=r-1;i>=l;i--)

#define fw(i,l,r) for (int i=l;i<r;i++)

#define fa(i,x) for (auto i:x)

using namespace std;

const int N=2e5+5;

int h,w,a,b;

int fac[N+1];

struct math {

	int fpow(int a,int p,int mod) {

		if (!p) return 1;

		int ans=fpow(a,p>>1,mod); ans*=ans; ans%=mod;

		if (p&1) {ans*=a; ans%=mod;}

		return ans;

	}

	int inv(int a,int mod) {return fpow(a,mod-2,mod);}

	void preC(int n,int mod) {

		fac[0]=1;

		fw (i,1,n+1) fac[i]=fac[i-1]*i%mod;

	}

	int getC(int k,int n,int mod) {if (k<0) return 0; if (k>n) return 0; if (!k) return 1; return fac[n]*inv(fac[k]*fac[n-k]%mod,mod)%mod;}

} m;

int ans=0;

signed main() {

	//freopen("aome.inp","r",stdin);

	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

	cin>>h>>w>>a>>b;

	/*

	Use inclusion - exlusion, we will count number of invalid paths

	Invalid path: A path that will enter the forbidden area at some point

	Check through all first columns of the forbidden area, we can see a valid path always go from

	the spot right above it down to it. So we just count easily.

	*/

	m.preC(N,MOD);

	ans=m.getC(w-1,h+w-2,MOD);

	fw (i,1,b+1) {

		//cout<<"Reach: "<<m.getC(i-1,h-a+i-2,MOD)<<", to end: "<<m.getC(a-1,w-i+a-1,MOD)<<"\n";

		ans-=m.getC(i-1,h-a+i-2,MOD)*m.getC(a-1,w-i+a-1,MOD)%MOD;

		if (ans<0) ans+=MOD;

	}

	cout<<ans;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 2.6208932670419105x):
#include<bits/stdc++.h>



using namespace std;



#define int long long



const int   N   = 2e5 + 1;

const int   mod = 1e9 + 7;



int qpow(int a,int exp) {

    int ans = 1;

    while(exp)  {

        if(exp & 1) ans = ans * a % mod;

        a = a * a % mod;  exp >>= 1;

    }

    return ans;

}



int F[N], I[N];

int h, w, a, b;



int combi(int n,int k)  {

    if(n < 0 || k < 0 || n < k) return 0;

    int ans = I[k] * I[n - k] % mod;

    return ans * F[n] % mod;

}

signed main()   {

    cin >> h >> w >> a >> b;



    F[0] = I[0] = 1;

    for(int i = 1 ; i <= h + w ; ++i)

        F[i] = F[i - 1] * i % mod;

    I[h + w] = qpow(F[h + w],mod - 2);

    for(int i = h + w - 1 ; i ; --i)

        I[i] = I[i + 1] * (i + 1) % mod;

    int ans = 0;

    for(int i = b + 1 ; i <= w ; ++i)

        ans = (ans + combi(i + h - a - 2,i - 1) * combi(w - i + a - 1,a - 1)) % mod;

    cout << ans << endl;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



typedef pair<int,int> ii;

#define fi first

#define se second



const int N = 2e5 + 5;

const int MOD = 1e9 + 7;



int h, w, a, b;

int fac[N], ifac[N];



int fpow(int x,int y) {

	int ret = 1;

	while (y) {

		if (y & 1) ret = 1LL * ret * x % MOD;

		x = 1LL * x * x % MOD;

		y >>= 1;

	}

	return ret;

}



int C(int n,int k) {

	if (n < k || k < 0) return 0;

	int ret = 1LL * ifac[k] * ifac[n - k] % MOD;

	ret = 1LL * ret * fac[n] % MOD;

	return ret; 

}



int main() {

	ios_base::sync_with_stdio(false);

	fac[0] = 1; for (int i = 1; i < N; ++i) fac[i] = 1LL * fac[i - 1] * i % MOD;

	ifac[N - 1] = fpow(fac[N - 1], MOD - 2);

	for (int i = N - 2; i >= 0; --i) ifac[i] = 1LL * ifac[i + 1] * (i + 1) % MOD;

	cin >> h >> w >> a >> b;

	int res = 0;

	for (int i = 1; i <= h - a; ++i) {

		int j = b + 1;

		int add;

		if (i == h - a) add = 1LL * C(i + j - 2, i - 1) * C(h - i + w - j, h - i) % MOD;

		else add = 1LL * C(i + j - 2, i - 1) * C(h - i + w - j - 1, w - j - 1) % MOD; 

		res += add; if (res >= MOD) res -= MOD;

	}

	cout << res;

}

// Faster C++ solution for the same problem (measured speedup: 3.166304960060319x):
#include<bits/stdc++.h>

using namespace std;

#define fi first

#define se second

#define pb push_back

#define mp make_pair

#define int long long

const int N = 1e5 + 5;

const int M = 1e6 + 5;

const int mod = 1e9 + 7;

typedef vector<int> vi;

typedef pair<int, int> ii;

typedef vector<ii> vii;

typedef set<int> si;

typedef map<string, int> msi;

int po(int x,int y)

{

	if(y == 0) return 1;

	int temp = po(x,y/2);

	if(y % 2 == 0) return temp * temp % mod;

	else return temp * temp % mod * x % mod;

}

int mul[2 * M], dv[2 * M];

int ckn(int k,int n)

{

	return mul[n] * dv[k] % mod * dv[n - k] % mod;

}

signed main(){

	int h, w , a , b;

	cin >> h >> w >> a >> b;

	mul[0] = dv[0] = 1;

	for(int i = 1 ; i <= h + w ; ++i)

	{

		mul[i] = mul[i - 1] * i % mod;

		dv[i] = dv[i - 1] * po(i,mod -2) % mod;

	}

	int ans = 0;

	for(int i = 1 ; i <= h - a ; ++i)

	{

		ans = (ans + ckn(i - 1,b + i - 2) * ckn(h - i,w - b + h - i - 1) % mod) % mod;

	}

	cout << ans;

}
// Slower C++ solution:
#include <bits/stdc++.h>

#define MOD 1000000007

#define pb push_back

#define int long long

#define bw(i,r,l) for (int i=r-1;i>=l;i--)

#define fw(i,l,r) for (int i=l;i<r;i++)

#define fa(i,x) for (auto i:x)

using namespace std;

const int N=2e5+5;

int h,w,a,b;

int fac[N+1];

struct math {

	int fpow(int a,int p,int mod) {

		if (!p) return 1;

		int ans=fpow(a,p>>1,mod); ans*=ans; ans%=mod;

		if (p&1) {ans*=a; ans%=mod;}

		return ans;

	}

	int inv(int a,int mod) {return fpow(a,mod-2,mod);}

	void preC(int n,int mod) {

		fac[0]=1;

		fw (i,1,n+1) fac[i]=fac[i-1]*i%mod;

	}

	int getC(int k,int n,int mod) {if (k<0) return 0; if (k>n) return 0; if (!k) return 1; return fac[n]*inv(fac[k]*fac[n-k]%mod,mod)%mod;}

} m;

int ans=0;

signed main() {

	//freopen("aome.inp","r",stdin);

	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

	cin>>h>>w>>a>>b;

	/*

	Use inclusion - exlusion, we will count number of invalid paths

	Invalid path: A path that will enter the forbidden area at some point

	Check through all first columns of the forbidden area, we can see a valid path always go from

	the spot right above it down to it. So we just count easily.

	*/

	m.preC(N,MOD);

	ans=m.getC(w-1,h+w-2,MOD);

	fw (i,1,b+1) {

		//cout<<"Reach: "<<m.getC(i-1,h-a+i-2,MOD)<<", to end: "<<m.getC(a-1,w-i+a-1,MOD)<<"\n";

		ans-=m.getC(i-1,h-a+i-2,MOD)*m.getC(a-1,w-i+a-1,MOD)%MOD;

		if (ans<0) ans+=MOD;

	}

	cout<<ans;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 2.6203655175769835x):
#include<bits/stdc++.h>

using namespace std;

#define fi first

#define se second

#define pb push_back

#define mp make_pair

#define int long long

const int N = 1e5 + 5;

const int M = 1e6 + 5;

const int mod = 1e9 + 7;

typedef vector<int> vi;

typedef pair<int, int> ii;

typedef vector<ii> vii;

typedef set<int> si;

typedef map<string, int> msi;

int po(int x,int y)

{

	if(y == 0) return 1;

	int temp = po(x,y/2);

	if(y % 2 == 0) return temp * temp % mod;

	else return temp * temp % mod * x % mod;

}

int mul[2 * M], dv[2 * M];

int ckn(int k,int n)

{

	return mul[n] * dv[k] % mod * dv[n - k] % mod;

}

signed main(){

	int h, w , a , b;

	cin >> h >> w >> a >> b;

	mul[0] = dv[0] = 1;

	for(int i = 1 ; i <= h + w ; ++i)

	{

		mul[i] = mul[i - 1] * i % mod;

		dv[i] = dv[i - 1] * po(i,mod -2) % mod;

	}

	int ans = 0;

	for(int i = 1 ; i <= h - a ; ++i)

	{

		ans = (ans + ckn(i - 1,b + i - 2) * ckn(h - i,w - b + h - i - 1) % mod) % mod;

	}

	cout << ans;

}