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.69602092082625x):
#include <cstdio>

#define rg register



const int N=200101,p=1e9+7;

int fac[N],inv[N],n,a,W,H,A,B;



inline int c(int x,int y) {return 1ll*fac[x]*inv[y]%p*inv[x-y]%p;}



inline int qpow(int A,int B){int r=1;for(;B;B>>=1,A=1ll*A*A%p)if(B&1)r=1ll*r*A%p;return r;}

template <typename _tp> inline void pls(int&A,_tp B){A=A+B<p?A+B:A+B-p;}

template <typename _tp> inline _tp max(_tp A,_tp B){return A>B?A:B;}



int main(){

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

	int lim=max(H-A+B-2,W-B+H);

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

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

	inv[lim]=qpow(fac[lim],p-2);

	for(rg int i=lim-1;i;--i)inv[i]=1ll*inv[i+1]*(i+1)%p;

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

		pls(a,1ll*c(i+B-1,i)*c(W-B+H-i-2,W-B-1)%p);

	printf("%d\n",a);return 0;

}
// 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.225707239991639x):
#include <cstdio>

#define rg register



const int N=200101,p=1e9+7;

int fac[N],inv[N],n,a,W,H,A,B;



inline int c(int x,int y) {return 1ll*fac[x]*inv[y]%p*inv[x-y]%p;}



inline int qpow(int A,int B){int r=1;for(;B;B>>=1,A=1ll*A*A%p)if(B&1)r=1ll*r*A%p;return r;}

template <typename _tp> inline void pls(int&A,_tp B){A=A+B<p?A+B:A+B-p;}

template <typename _tp> inline _tp max(_tp A,_tp B){return A>B?A:B;}



int main(){

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

	int lim=max(H-A+B-2,W-B+H);

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

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

	inv[lim]=qpow(fac[lim],p-2);

	for(rg int i=lim-1;i;--i)inv[i]=1ll*inv[i+1]*(i+1)%p;

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

		pls(a,1ll*c(i+B-1,i)*c(W-B+H-i-2,W-B-1)%p);

	printf("%d\n",a);return 0;

}
// 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.226759713084141x):
#include <cstdio>

#define rg register



const int N=200101,p=1e9+7;

int fac[N],inv[N],n,a,W,H,A,B;



inline int c(int x,int y) {return 1ll*fac[x]*inv[y]%p*inv[x-y]%p;}



inline int qpow(int A,int B){int r=1;for(;B;B>>=1,A=1ll*A*A%p)if(B&1)r=1ll*r*A%p;return r;}

template <typename _tp> inline void pls(int&A,_tp B){A=A+B<p?A+B:A+B-p;}

template <typename _tp> inline _tp max(_tp A,_tp B){return A>B?A:B;}



int main(){

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

	int lim=max(H-A+B-2,W-B+H);

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

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

	inv[lim]=qpow(fac[lim],p-2);

	for(rg int i=lim-1;i;--i)inv[i]=1ll*inv[i+1]*(i+1)%p;

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

		pls(a,1ll*c(i+B-1,i)*c(W-B+H-i-2,W-B-1)%p);

	printf("%d\n",a);return 0;

}
// 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.560532551384807x):
#include <cstdio>

#define rg register



const int N=200101,p=1e9+7;

int fac[N],inv[N],n,a,W,H,A,B;



inline int c(int x,int y) {return 1ll*fac[x]*inv[y]%p*inv[x-y]%p;}



inline int qpow(int A,int B){int r=1;for(;B;B>>=1,A=1ll*A*A%p)if(B&1)r=1ll*r*A%p;return r;}

template <typename _tp> inline void pls(int&A,_tp B){A=A+B<p?A+B:A+B-p;}

template <typename _tp> inline _tp max(_tp A,_tp B){return A>B?A:B;}



int main(){

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

	int lim=max(H-A+B-2,W-B+H);

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

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

	inv[lim]=qpow(fac[lim],p-2);

	for(rg int i=lim-1;i;--i)inv[i]=1ll*inv[i+1]*(i+1)%p;

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

		pls(a,1ll*c(i+B-1,i)*c(W-B+H-i-2,W-B-1)%p);

	printf("%d\n",a);return 0;

}
// 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.59629471000712x):
#include <cstdio>

#define rg register



const int N=200101,p=1e9+7;

int fac[N],inv[N],n,a,W,H,A,B;



inline int c(int x,int y) {return 1ll*fac[x]*inv[y]%p*inv[x-y]%p;}



inline int qpow(int A,int B){int r=1;for(;B;B>>=1,A=1ll*A*A%p)if(B&1)r=1ll*r*A%p;return r;}

template <typename _tp> inline void pls(int&A,_tp B){A=A+B<p?A+B:A+B-p;}

template <typename _tp> inline _tp max(_tp A,_tp B){return A>B?A:B;}



int main(){

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

	int lim=max(H-A+B-2,W-B+H);

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

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

	inv[lim]=qpow(fac[lim],p-2);

	for(rg int i=lim-1;i;--i)inv[i]=1ll*inv[i+1]*(i+1)%p;

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

		pls(a,1ll*c(i+B-1,i)*c(W-B+H-i-2,W-B-1)%p);

	printf("%d\n",a);return 0;

}
// 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.398501395257732x):
#include <cstdio>

#define rg register



const int N=200101,p=1e9+7;

int fac[N],inv[N],n,a,W,H,A,B;



inline int c(int x,int y) {return 1ll*fac[x]*inv[y]%p*inv[x-y]%p;}



inline int qpow(int A,int B){int r=1;for(;B;B>>=1,A=1ll*A*A%p)if(B&1)r=1ll*r*A%p;return r;}

template <typename _tp> inline void pls(int&A,_tp B){A=A+B<p?A+B:A+B-p;}

template <typename _tp> inline _tp max(_tp A,_tp B){return A>B?A:B;}



int main(){

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

	int lim=max(H-A+B-2,W-B+H);

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

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

	inv[lim]=qpow(fac[lim],p-2);

	for(rg int i=lim-1;i;--i)inv[i]=1ll*inv[i+1]*(i+1)%p;

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

		pls(a,1ll*c(i+B-1,i)*c(W-B+H-i-2,W-B-1)%p);

	printf("%d\n",a);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.2206134476956791x):
#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;

}
// 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: 1.2214260347412498x):
#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;

}
// 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: 1.2240636812942398x):
#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;

}
// 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: 16.557066413567888x):
#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 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;

}

// Faster C++ solution for the same problem (measured speedup: 5.228101861533714x):
#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);

}