stablegradients/pie-gem5-pairs huggingface dataset:
// 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: 13.702270138097752x):
#include<cstdio>



#define LL long long

#define MAXN 100000

#define MOD 1000000007

LL fac[2*MAXN+5];

LL inv[2*MAXN+5];



LL Pow(LL x,LL p){

    LL ret=1;

    while(p){

        if(p&1)

            ret=ret*x%MOD;

        x=(x*x)%MOD;

        p>>=1;

    }

    return ret;

}



void Prep(int N){

    fac[0]=1;

    for(int i=1;i<=N;i++)

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

    inv[0]=1;

    inv[N]=Pow(fac[N],MOD-2);

    for(int i=N-1;i>=1;i--)

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

}



LL C(int m,int n){

    return fac[m]*inv[n]%MOD*inv[m-n]%MOD;

}



int main(){

    int H,W,A,B;

    scanf("%d%d%d%d",&H,&W,&A,&B);

    Prep(H+W);

    LL Ans=0;

    for(int i=B+1;i<=W;i++){

        LL tmp1=C(H-A+i-2,i-1);

        LL tmp2=C(A+W-i-1,W-i);

        Ans=(Ans+(tmp1*tmp2)%MOD)%MOD;

    }

    printf("%lld",Ans);

}
// Slower C++ solution:
#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;

}


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



#define LL long long

#define MAXN 100000

#define MOD 1000000007

LL fac[2*MAXN+5];

LL inv[2*MAXN+5];



LL Pow(LL x,LL p){

    LL ret=1;

    while(p){

        if(p&1)

            ret=ret*x%MOD;

        x=(x*x)%MOD;

        p>>=1;

    }

    return ret;

}



void Prep(int N){

    fac[0]=1;

    for(int i=1;i<=N;i++)

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

    inv[0]=1;

    inv[N]=Pow(fac[N],MOD-2);

    for(int i=N-1;i>=1;i--)

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

}



LL C(int m,int n){

    return fac[m]*inv[n]%MOD*inv[m-n]%MOD;

}



int main(){

    int H,W,A,B;

    scanf("%d%d%d%d",&H,&W,&A,&B);

    Prep(H+W);

    LL Ans=0;

    for(int i=B+1;i<=W;i++){

        LL tmp1=C(H-A+i-2,i-1);

        LL tmp2=C(A+W-i-1,W-i);

        Ans=(Ans+(tmp1*tmp2)%MOD)%MOD;

    }

    printf("%lld",Ans);

}
// Slower C++ solution:
#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;

}

	

	




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



#define LL long long

#define MAXN 100000

#define MOD 1000000007

LL fac[2*MAXN+5];

LL inv[2*MAXN+5];



LL Pow(LL x,LL p){

    LL ret=1;

    while(p){

        if(p&1)

            ret=ret*x%MOD;

        x=(x*x)%MOD;

        p>>=1;

    }

    return ret;

}



void Prep(int N){

    fac[0]=1;

    for(int i=1;i<=N;i++)

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

    inv[0]=1;

    inv[N]=Pow(fac[N],MOD-2);

    for(int i=N-1;i>=1;i--)

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

}



LL C(int m,int n){

    return fac[m]*inv[n]%MOD*inv[m-n]%MOD;

}



int main(){

    int H,W,A,B;

    scanf("%d%d%d%d",&H,&W,&A,&B);

    Prep(H+W);

    LL Ans=0;

    for(int i=B+1;i<=W;i++){

        LL tmp1=C(H-A+i-2,i-1);

        LL tmp2=C(A+W-i-1,W-i);

        Ans=(Ans+(tmp1*tmp2)%MOD)%MOD;

    }

    printf("%lld",Ans);

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

using namespace std;



long long mod=1e9+7;

long long fact[200010];

long long poww(long long a, long long b){

  long long res = 1;

  while (b){

    if (b & 1) res = (res * a) % mod;

    a = (a * a) % mod;

    b >>= 1;

  }

  return res;

}

long long C(long long k,long long n)

{

    return fact[n] * poww(fact[k],mod-2) % mod * poww(fact[n-k],mod-2) % mod;

}

int main()

{

    long long h,w,a,b;

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

    fact[0]=1;

    for(long long i=1;i<=200000;i++)

    {

        fact[i]=fact[i-1]*i;

        fact[i]=fact[i] % mod;

    }

    //cout << C(3,5);

    long long ans=0;

    for(long long i=1;i<=w-b;i++)

    {

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

        ans=ans%mod;

    }

    cout << ans << "\n";

}


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



#define LL long long

#define MAXN 100000

#define MOD 1000000007

LL fac[2*MAXN+5];

LL inv[2*MAXN+5];



LL Pow(LL x,LL p){

    LL ret=1;

    while(p){

        if(p&1)

            ret=ret*x%MOD;

        x=(x*x)%MOD;

        p>>=1;

    }

    return ret;

}



void Prep(int N){

    fac[0]=1;

    for(int i=1;i<=N;i++)

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

    inv[0]=1;

    inv[N]=Pow(fac[N],MOD-2);

    for(int i=N-1;i>=1;i--)

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

}



LL C(int m,int n){

    return fac[m]*inv[n]%MOD*inv[m-n]%MOD;

}



int main(){

    int H,W,A,B;

    scanf("%d%d%d%d",&H,&W,&A,&B);

    Prep(H+W);

    LL Ans=0;

    for(int i=B+1;i<=W;i++){

        LL tmp1=C(H-A+i-2,i-1);

        LL tmp2=C(A+W-i-1,W-i);

        Ans=(Ans+(tmp1*tmp2)%MOD)%MOD;

    }

    printf("%lld",Ans);

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

using namespace std;

vector<long long> res1; 

vector<long long> res2;

long long mod=1e9+7;

long long fact[200010];

long long poww(long long x,long long n)

{

	if(n==0)

	return 1*1LL;

	else if(n%2==0)

	{

		return poww(x,n/2)*poww(x,n/2)%mod;

	}

	else if(n%2!=0)

	{

		return poww(x,n/2)*poww(x,n/2)%mod*x%mod;

	}

}

long long C(long long k,long long n)

{

	if(k==0||n==0) return 1*1LL;

	if(k>n) return 0*1LL;

	return poww(fact[k],mod-2)%mod * poww(fact[n-k],mod-2)%mod * fact[n]%mod;

}

int main()

{

	//ios_base::sync_with_stdio(0);

	//cin.tie(0);

	//cout.tie(0);

	fact[0]=1*1LL;

	for(long long i=1;i<=200000;i++)

	{

		fact[i]=(fact[i-1]*i)%mod;

	}

	long long h,w,a,b;

	long long ans=0;

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

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

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

		ans=ans%mod;

	}

	cout<<ans%mod;

	//cout  << C(99,1000);

}

//yyyyyyy

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



#define LL long long

#define MAXN 100000

#define MOD 1000000007

LL fac[2*MAXN+5];

LL inv[2*MAXN+5];



LL Pow(LL x,LL p){

    LL ret=1;

    while(p){

        if(p&1)

            ret=ret*x%MOD;

        x=(x*x)%MOD;

        p>>=1;

    }

    return ret;

}



void Prep(int N){

    fac[0]=1;

    for(int i=1;i<=N;i++)

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

    inv[0]=1;

    inv[N]=Pow(fac[N],MOD-2);

    for(int i=N-1;i>=1;i--)

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

}



LL C(int m,int n){

    return fac[m]*inv[n]%MOD*inv[m-n]%MOD;

}



int main(){

    int H,W,A,B;

    scanf("%d%d%d%d",&H,&W,&A,&B);

    Prep(H+W);

    LL Ans=0;

    for(int i=B+1;i<=W;i++){

        LL tmp1=C(H-A+i-2,i-1);

        LL tmp2=C(A+W-i-1,W-i);

        Ans=(Ans+(tmp1*tmp2)%MOD)%MOD;

    }

    printf("%lld",Ans);

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

#include<algorithm>

#define mod 1000000007

using namespace std;

typedef long long ll;

#define LL long long 

ll je[200010];

ll x,y;

LL Gcd(LL a, LL b, LL &x, LL &y)

{

    if(b==0)

	{

        x=1;

        y=0;

        return a;

    }

    LL gcd=Gcd(b,a%b,x,y);

    LL tmp=x;

    x=y;

    y=tmp-(a/b)*y;

    return gcd;

}

LL C(LL m,LL n)

{

    Gcd(je[m]*je[n-m]%mod,mod,x,y);

    return je[n]*(x+mod)%mod;

}

int main()

{

	LL H,W,A,B;

    je[0]=1;

    for(LL i=1;i<200005;i++)

        je[i]=(je[i-1]*i)%mod;

    scanf("%lld%lld%lld%lld",&H,&W,&A,&B);

    LL ans=0;

    for(LL i=B+1;i<=W;i++)

    {

        LL tmp=(C(H-A-1,i-1+H-A-1)*C(W-i,W-i+A-1))%mod;

        ans=(ans+tmp)%mod;

    }

    printf("%lld",ans);

    return 0;

}


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



#define LL long long

#define MAXN 100000

#define MOD 1000000007

LL fac[2*MAXN+5];

LL inv[2*MAXN+5];



LL Pow(LL x,LL p){

    LL ret=1;

    while(p){

        if(p&1)

            ret=ret*x%MOD;

        x=(x*x)%MOD;

        p>>=1;

    }

    return ret;

}



void Prep(int N){

    fac[0]=1;

    for(int i=1;i<=N;i++)

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

    inv[0]=1;

    inv[N]=Pow(fac[N],MOD-2);

    for(int i=N-1;i>=1;i--)

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

}



LL C(int m,int n){

    return fac[m]*inv[n]%MOD*inv[m-n]%MOD;

}



int main(){

    int H,W,A,B;

    scanf("%d%d%d%d",&H,&W,&A,&B);

    Prep(H+W);

    LL Ans=0;

    for(int i=B+1;i<=W;i++){

        LL tmp1=C(H-A+i-2,i-1);

        LL tmp2=C(A+W-i-1,W-i);

        Ans=(Ans+(tmp1*tmp2)%MOD)%MOD;

    }

    printf("%lld",Ans);

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

#include<queue>

#include<stdio.h>

#include<map>

#include<set>

#include<string.h>

#include<algorithm>

#include<iostream>

#include<math.h>

#define mp make_pair

using namespace std;

typedef long long ll;

inline ll in()

{

    ll res=0,p=1;

    char c=getchar();

    while(c<'0'||c>'9') {if(c=='-') p=-1; c=getchar();}

    while(c>='0'&&c<='9') res=res*10+c-48,c=getchar();

    return p*res;

}

void out(ll x)

{

    if (x>9) out(x/10);

    putchar(x%10+48);

}

void outn(ll x)

{

    if (x<0){

        putchar('-');

        out(-x);

    }else out(x);

    putchar(10);

}

const int mod = 1e9 + 7, inf = 0x3f3f3f3f;

//const double pi = acos(-1.0);

const ll INF = 0x3f3f3f3f3f3f3f3f;

const int dx[4] = {0, 0, -1, 1}, dy[4] = {1, -1, 0, 0};



ll gcd(ll a, ll b){return b == 0 ? a : gcd(b, a % b);}

ll quickpow(ll x, int k)

{

    ll res = 1;

    while(k){

        if(k & 1) res = (res * x) % mod;

        k >>= 1, x = (x * x) % mod;

    }

    return res;

}

ll fac[200005] = {1};

ll C(int n, int m){return (fac[n] * quickpow((fac[m] * fac[n - m]) % mod, mod - 2)) % mod;}

const int maxn = 1e5 + 5;



int main()

{

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

    int h, w, a, b;

    h = in(); w = in(); a = in(); b = in();

    ll ans = 0;

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

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

    outn(ans);

    return 0;

}


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



#define LL long long

#define MAXN 100000

#define MOD 1000000007

LL fac[2*MAXN+5];

LL inv[2*MAXN+5];



LL Pow(LL x,LL p){

    LL ret=1;

    while(p){

        if(p&1)

            ret=ret*x%MOD;

        x=(x*x)%MOD;

        p>>=1;

    }

    return ret;

}



void Prep(int N){

    fac[0]=1;

    for(int i=1;i<=N;i++)

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

    inv[0]=1;

    inv[N]=Pow(fac[N],MOD-2);

    for(int i=N-1;i>=1;i--)

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

}



LL C(int m,int n){

    return fac[m]*inv[n]%MOD*inv[m-n]%MOD;

}



int main(){

    int H,W,A,B;

    scanf("%d%d%d%d",&H,&W,&A,&B);

    Prep(H+W);

    LL Ans=0;

    for(int i=B+1;i<=W;i++){

        LL tmp1=C(H-A+i-2,i-1);

        LL tmp2=C(A+W-i-1,W-i);

        Ans=(Ans+(tmp1*tmp2)%MOD)%MOD;

    }

    printf("%lld",Ans);

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

using namespace std;



#define fastio ios::sync_with_stdio(); cin.tie(0); cout.tie(0);

#define pb push_back

#define ll long long

#define fi first

#define se second

#define maxn 200002



const int mod = 1e9+7 ;

typedef vector<int> vi;

typedef pair<int, int> pii;

typedef vector<pii> vii;



ll fac[maxn];



long long binpow(long long a, long long b) {

    if (b == 0)

        return 1;

    long long res = binpow(a, b / 2);

    if (b % 2)

        return (res * res % mod) * a % mod;

    else

        return (res * res % mod);

}



void kt()

{

	fac[0] = 1;

	fac[1] = 1;

	for (int i = 2; i <  maxn; i++)

	{

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

		fac[i] %= mod;

	}

}



ll c(ll k, ll n)

{

	assert(n >= k);

	return ((fac[n]) *  binpow((fac[k] * fac[n-k]) % mod, mod - 2)) % mod;

}



signed main()

{

	fastio;

	ll h, w, a, b;	cin >> h >> w >> a >> b;

	kt();

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

//	cout << ans << endl;

	for (ll i = 1; i <= a; i++)

	{

		ll temp1 = c(b-1, b + h - i - 1);	// b * (h - i + 1)

		ll temp2 = c(i-1, i + w - b - 2);	// i * (w - b)

		ans = (ans - (temp1 * temp2 % mod) + mod) % mod;

	}

	cout << ans;

}






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

using namespace std;

typedef pair<int,int> ii;

typedef vector<int> vi;



typedef long long ll;

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

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

#define fi first

#define se second

#define eb emplace_back

#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);



#define int ll

const int mod = 1e9+7 ;



int n,m,a,b;

int fft[200001], fft_sz = 1;

int fact(const int& n){

	for(;n > fft_sz; ++fft_sz) fft[fft_sz+1] = (fft[fft_sz]*(fft_sz+1)) % mod;

	return fft[n];

}

int mul (const int& a, const int& b){

	return a * b %mod;

}

int mi(const int& a, const int& b){

	int ans = (a-b) % mod;

	return (ans < 0 ? ans + mod : ans);

}

int binpow(int a, int b){

	int res = 1;

	while(b){

		if (b & 1) res = mul(res,a);

		a = mul(a,a), b >>= 1;

	}

	return res;

}

int divide(const int& a, const int& b){

	assert(b > 0);

	return mul(a,binpow(b,mod-2)); 

}

int c(const int& a, const int& b){

	assert(b >= a);

	return divide(fact(b), mul(fact(a), fact(b-a)));

}

int path0(const int& n, const int& m){

	return c(n-1, n+m-2);

}

int path(const int& r, const int& c, const int& row, const int& col){

	return path0(row-r+1, col-c+1);

}



signed main() {

	fastio ;

	fft[0] = fft[1] = 1LL;

	cin >> n >> m >> a >> b;

	int ans = path0(n,m);

	for(int i = 0, r = n, c = b; i < a; ++i, --r){

		ans = mi(ans, mul(path(1,1 ,r,c), path(r,c+1, n,m)));

	}

	cout << (ans % mod) << endl;

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

using namespace std;



#define fastio ios::sync_with_stdio(); cin.tie(0); cout.tie(0);

#define pb push_back

#define ll long long

#define fi first

#define se second

#define maxn 200002



const int mod = 1e9+7 ;

typedef vector<int> vi;

typedef pair<int, int> pii;

typedef vector<pii> vii;



ll fac[maxn];



long long binpow(long long a, long long b) {

    if (b == 0)

        return 1;

    long long res = binpow(a, b / 2);

    if (b % 2)

        return (res * res % mod) * a % mod;

    else

        return (res * res % mod);

}



void kt()

{

	fac[0] = 1;

	fac[1] = 1;

	for (int i = 2; i <  maxn; i++)

	{

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

		fac[i] %= mod;

	}

}



ll c(ll k, ll n)

{

	assert(n >= k);

	return ((fac[n]) *  binpow((fac[k] * fac[n-k]) % mod, mod - 2)) % mod;

}



signed main()

{

	fastio;

	ll h, w, a, b;	cin >> h >> w >> a >> b;

	kt();

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

//	cout << ans << endl;

	for (ll i = 1; i <= a; i++)

	{

		ll temp1 = c(b-1, b + h - i - 1);	// b * (h - i + 1)

		ll temp2 = c(i-1, i + w - b - 2);	// i * (w - b)

		ans = (ans - (temp1 * temp2 % mod) + mod) % mod;

	}

	cout << ans;

}






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

using namespace std;

typedef pair<int,int> ii;

typedef vector<int> vi;



typedef long long ll;

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

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

#define fi first

#define se second

#define eb emplace_back

#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);



#define int ll

const int mod = 1e9+7 ;

const int mn = 100000;

int n,m,a,b;

int fft[(mn+mn-2+1)], fft_sz = 1;

int fact(const int& n){

	for(;n > fft_sz; ++fft_sz) fft[fft_sz+1] = (fft[fft_sz]*(fft_sz+1)) % mod;

	return fft[n];

}

int mul (const int& a, const int& b){

	return a * b %mod;

}

int mi(const int& a, const int& b){

	int ans = (a-b) % mod;

	return (ans < 0 ? ans + mod : ans);

}

int binpow(int a, int b){

	int res = 1;

	while(b){

		if (b & 1) res = mul(res,a);

		a = mul(a,a), b >>= 1;

	}

	return res;

}

int divide(const int& a, const int& b){

	assert(b > 0);

	return mul(a,binpow(b,mod-2)); 

}

int c(const int& a, const int& b){

	assert(b >= a);

	return divide(fact(b), mul(fact(a), fact(b-a)));

}

int path0(const int& n, const int& m){

	return c(n-1, n+m-2);

}

int path(const int& r, const int& c, const int& row, const int& col){

	return path0(row-r+1, col-c+1);

}



signed main() {

	fastio ;

	fft[0] = fft[1] = 1LL;

	cin >> n >> m >> a >> b;

	int ans = path0(n,m);

	for(int i = 0, r = n, c = b; i < a; ++i, --r){

		ans = mi(ans, mul(path(1,1 ,r,c), path(r,c+1, n,m)));

	}

	cout << (ans % mod) << endl;

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

using namespace std;



#define fastio ios::sync_with_stdio(); cin.tie(0); cout.tie(0);

#define pb push_back

#define ll long long

#define fi first

#define se second

#define maxn 200002



const int mod = 1e9+7 ;

typedef vector<int> vi;

typedef pair<int, int> pii;

typedef vector<pii> vii;



ll fac[maxn];



long long binpow(long long a, long long b) {

    if (b == 0)

        return 1;

    long long res = binpow(a, b / 2);

    if (b % 2)

        return (res * res % mod) * a % mod;

    else

        return (res * res % mod);

}



void kt()

{

	fac[0] = 1;

	fac[1] = 1;

	for (int i = 2; i <  maxn; i++)

	{

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

		fac[i] %= mod;

	}

}



ll c(ll k, ll n)

{

	assert(n >= k);

	return ((fac[n]) *  binpow((fac[k] * fac[n-k]) % mod, mod - 2)) % mod;

}



signed main()

{

	fastio;

	ll h, w, a, b;	cin >> h >> w >> a >> b;

	kt();

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

//	cout << ans << endl;

	for (ll i = 1; i <= a; i++)

	{

		ll temp1 = c(b-1, b + h - i - 1);	// b * (h - i + 1)

		ll temp2 = c(i-1, i + w - b - 2);	// i * (w - b)

		ans = (ans - (temp1 * temp2 % mod) + mod) % mod;

	}

	cout << ans;

}






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

using namespace std;

typedef pair<int,int> ii;

typedef vector<int> vi;



typedef long long ll;

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

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

#define fi first

#define se second

#define eb emplace_back

#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);



#define int ll

const int mod = 1e9+7 ;



int n,m,a,b;

int fft[199999], fft_sz = 1;

int fact(const int& n){

	for(;n > fft_sz; ++fft_sz) fft[fft_sz+1] = (fft[fft_sz]*(fft_sz+1)) % mod;

	return fft[n];

}

int mul (const int& a, const int& b){

	return a * b %mod;

}

int mi(const int& a, const int& b){

	int ans = (a-b) % mod;

	return (ans < 0 ? ans + mod : ans);

}

int binpow(int a, int b){

	int res = 1;

	while(b){

		if (b & 1) res = mul(res,a);

		a = mul(a,a), b >>= 1;

	}

	return res;

}

int divide(const int& a, const int& b){

	assert(b > 0);

	return mul(a,binpow(b,mod-2)); 

}

int c(const int& a, const int& b){

	assert(b >= a);

	return divide(fact(b), mul(fact(a), fact(b-a)));

}

int path0(const int& n, const int& m){

	return c(n-1, n+m-2);

}

int path(const int& r, const int& c, const int& row, const int& col){

	return path0(row-r+1, col-c+1);

}



signed main() {

	fastio ;

	fft[0] = fft[1] = 1LL;

	cin >> n >> m >> a >> b;

	int ans = path0(n,m);

	for(int i = 0, r = n, c = b; i < a; ++i, --r){

		ans = mi(ans, mul(path(1,1 ,r,c), path(r,c+1, n,m)));

	}

	cout << (ans % mod) << endl;

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

using namespace std;

vector<long long> res1; 

vector<long long> res2;

long long mod=1e9+7;

long long fact[200010];

long long poww(long long x,long long n)

{

	if(n==0)

	return 1*1LL;

	else if(n%2==0)

	{

		return poww(x,n/2)*poww(x,n/2)%mod;

	}

	else if(n%2!=0)

	{

		return poww(x,n/2)*poww(x,n/2)%mod*x%mod;

	}

}

long long C(long long k,long long n)

{

	if(k==0||n==0) return 1*1LL;

	if(k>n) return 0*1LL;

	return poww(fact[k],mod-2)%mod * poww(fact[n-k],mod-2)%mod * fact[n]%mod;

}

int main()

{

	//ios_base::sync_with_stdio(0);

	//cin.tie(0);

	//cout.tie(0);

	fact[0]=1*1LL;

	for(long long i=1;i<=200000;i++)

	{

		fact[i]=(fact[i-1]*i)%mod;

	}

	long long h,w,a,b;

	long long ans=0;

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

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

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

		ans=ans%mod;

	}

	cout<<ans%mod;

	//cout  << C(99,1000);

}

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

#include<cstring>

const int MAXN=100005,MOD=1000000007;



int PowMod(int a,int b)

{

	int ret=1;

	while(b)

	{

		if(b&1)

			ret=(1LL*ret*a)%MOD;

		a=(1LL*a*a)%MOD;

		b>>=1;

	}

	return ret;

}

int Inv(int a)

{return PowMod(a,MOD-2);}



int tmp1[MAXN],tmp2[MAXN];



int main()

{

	int H,W,A,B;

	scanf("%d%d%d%d",&H,&W,&A,&B);

	

	tmp1[1]=1;

	for(int i=2;i<=H-A;i++)

		tmp1[i]=1LL*tmp1[i-1]*(B-2+i)%MOD*Inv(i-1)%MOD;

	

	tmp2[1]=1;

	for(int i=2;i<=H;i++)

		tmp2[i]=1LL*tmp2[i-1]*(W-B-2+i)%MOD*Inv(i-1)%MOD;

		

	int ans=0;

	for(int i=1;i<=H-A;i++)

		ans=(ans+1LL*tmp1[i]*tmp2[H-i+1]%MOD)%MOD;

	

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

	

	return 0;

}