stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#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;

}

	

	




// Optimized solution to the same problem (faster):
#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);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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";

}


// Optimized solution to the same problem (faster):
#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);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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

// Optimized solution to the same problem (faster):
#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);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}


// Optimized solution to the same problem (faster):
#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);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}


// Optimized solution to the same problem (faster):
#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);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}






// Optimized solution to the same problem (faster):
#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;

}




// Fastest known solution for this problem:
// Original C++ solution (slower):
#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);

}

// Optimized solution to the same problem (faster):
#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;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<cstdio>

#include<algorithm>

using namespace std;

#define mod 1000000007

using namespace std;

typedef long long LL;

LL je[200010];

LL x,y;

void Build()

{

	je[0]=je[1]=1;

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

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

	return;

}

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;

	Build();

    LL ans=0;

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

    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;

    }

	/*

	

	(a,......)

	*/

    printf("%lld",ans);

    return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<algorithm>

using namespace std;

#define mod 1000000007

#define N 200005

typedef long long LL;

LL f1[N],s[N];

int n;

inline LL pow(LL a,int k)

{

    LL x=1;

    while(k)

	{

        if(k&1)

			x=x*a%mod;

        a=a*a%mod;

        k>>=1;

    }

    return x;

}

inline void prepare() 

{

    s[0]=1;

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

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

    f1[0]=1;

    f1[n]=pow(s[n],mod-2);

    for(int i=n-1;i>0;i--)

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

}

inline LL C(int a,int b)

{

    if(a<0||b<0)

		return 1;

    return s[a]*f1[b]%mod*f1[a-b]%mod;

}

int main()

{

    int h,w,a,b;

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

    n=h+w-2;

    prepare();

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

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

	{

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

        ans=(ans+mod)%mod;

    }

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

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<cstdio>



using namespace std;

typedef long long LL;

const LL mod=1000000007,N=200005;

LL je[N+5];

LL x,y;

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

{

	if(!b)

	{

		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<=N;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;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<algorithm>

using namespace std;

#define mod 1000000007

#define N 200005

typedef long long LL;

LL f1[N],s[N];

int n;

inline LL pow(LL a,int k)

{

    LL x=1;

    while(k)

	{

        if(k&1)

			x=x*a%mod;

        a=a*a%mod;

        k>>=1;

    }

    return x;

}

inline void prepare() 

{

    s[0]=1;

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

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

    f1[0]=1;

    f1[n]=pow(s[n],mod-2);

    for(int i=n-1;i>0;i--)

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

}

inline LL C(int a,int b)

{

    if(a<0||b<0)

		return 1;

    return s[a]*f1[b]%mod*f1[a-b]%mod;

}

int main()

{

    int h,w,a,b;

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

    n=h+w-2;

    prepare();

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

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

	{

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

        ans=(ans+mod)%mod;

    }

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

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

#define mod 1000000007

#define ll long long

using namespace std;



ll exgcd(ll a, ll b, ll & x, ll & y)

{

	if (b == 0)

	{

		x = 1;

		y = 0;

		return a;

	}

	ll d = exgcd(b, a % b, y, x);

	y -= a / b * x;

	return d;

}

ll inv(ll a, ll MOD)

{

	ll x, y;

	exgcd(a, MOD, x, y);

	x = (x % MOD + MOD) % MOD;

	return x;

}

ll fac[200010];

void init(int p)

{

	fac[0] = 1;

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

}

ll lucas2(ll n, ll m)

{

	ll ret = 1, a, b;

	while (n && m)

	{

		a = n % mod, b = m % mod;

		if (a < b) return 0;

		ret = ret * fac[a] % mod * inv(fac[b] * fac[a - b] % mod, mod) % mod;

		n /= mod, m /= mod;

	}

	return ret;

}

int main()

{

	ll x, y, n, m;



	scanf("%lld%lld%lld%lld", &n, &m, &x, &y);

	ll ans = 0;

	init(200005);

	ll z = y, p = n + m - 2;

	for (ll i = 0; i <= n - x - 1; i++)

	{

		ans = ans + lucas2(z + i - 1, i) * lucas2(p - z - i, n - 1 - i) % mod;

		ans %= mod;

		//printf("1  %lld  %lld\n", i, ans);

	}

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

}

// Optimized solution to the same problem (faster):
#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[fac[i]]=Pow(fac[i],MOD-2)=Pow(1,MOD-2)...Pow(i,MOD-2)

    //inv[fac[i-1]]=Pow(fac[i-1],MOD-2)=Pow(1,MOD-2)...Pow(i-1,MOD-2)=Pow(fac[i],MOD-2)/Pow(i,MOD-2)=inv[i]*i

    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);

        //C(m+n-x-y-2,m-x-1)

        //(H-A,i) -> (H,W)

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

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

    }

    printf("%lld",Ans);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<cstdio>

#include<algorithm>

using namespace std;

#define mod 1000000007

using namespace std;

typedef long long LL;

LL je[200010];

LL x,y;

void Build()

{

	je[0]=je[1]=1;

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

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

	return;

}

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;

	Build();

    LL ans=0;

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

    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;

}

// Optimized solution to the same problem (faster):
#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[fac[i]]=Pow(fac[i],MOD-2)=Pow(1,MOD-2)...Pow(i,MOD-2)

    //inv[fac[i-1]]=Pow(fac[i-1],MOD-2)=Pow(1,MOD-2)...Pow(i-1,MOD-2)=Pow(fac[i],MOD-2)/Pow(i,MOD-2)=inv[i]*i

    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);

        //C(m+n-x-y-2,m-x-1)

        //(H-A,i) -> (H,W)

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

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

    }

    printf("%lld",Ans);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<cstdio>

#define MOD 1000000007

#define MAXS 200000

typedef long long LL;



int h,w,a,b,ans=0;

LL jc[MAXS+5],inv[MAXS+5];



LL Powm(LL x,LL M) {

	LL cf=x,ret=1;

	while(M) {

		if(M&1)

			ret=ret*cf%MOD;

		cf=cf*cf%MOD;

		M>>=1;

	}

	return ret;

}

void Prepare() {

	jc[0]=1;

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

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

	inv[0]=1;

	inv[MAXS]=Powm(jc[MAXS],MOD-2);

	for(LL i=MAXS-1;i>0;i--)

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

}

LL C(LL a,LL b) {

	if(a<0||b<0) return 1;

	return jc[a]*inv[b]%MOD*inv[a-b]%MOD;

}

int main() {

	Prepare();

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

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

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

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

	return 0;

}

// Optimized solution to the same problem (faster):
#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[fac[i]]=Pow(fac[i],MOD-2)=Pow(1,MOD-2)...Pow(i,MOD-2)

    //inv[fac[i-1]]=Pow(fac[i-1],MOD-2)=Pow(1,MOD-2)...Pow(i-1,MOD-2)=Pow(fac[i],MOD-2)/Pow(i,MOD-2)=inv[i]*i

    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);

        //C(m+n-x-y-2,m-x-1)

        //(H-A,i) -> (H,W)

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

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

    }

    printf("%lld",Ans);

}

// Fastest known solution for this problem: