stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <bits/stdc++.h>



#define ft first

#define sd second

#define sz(x) ((int)x.size())



using namespace std;



typedef long long ll;

typedef pair<int, int> pii;

typedef pair<ll, ll> pll;



const int D = 1000 * 1000 * 1000 + 7, MAXN = 2 * 100 * 1000 + 123;





void multi(int& x, int y) { x = (ll)x * y % D; }

int inv(int x) {

	int res = 1;

	for (int i = D - 2; i; i >>= 1, x = (ll)x * x % D)

		if (i & 1)

			res = (ll)res * x % D;

	return res;

}



int r, c, a, b, ans, jav, fact[MAXN];





int main() {

	fact[0] = 1;

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

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

	cin >> r >> c >> a >> b;

	for (int i = 0; i < r - a; i++) {

		jav = fact[b + i - 1];

		multi(jav, inv(fact[b - 1]));

		multi(jav, inv(fact[i]));

		multi(jav, fact[r - i + c - b - 2]);

		multi(jav, inv(fact[r - i - 1]));

		multi(jav, inv(fact[c - b - 1]));

		ans += jav;

		ans %= D;

	}

	cout << ans;

	return 0;

}

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

#include<cstdio>

#include<cstring>

#include<cmath>

#include<algorithm>

using namespace std;

typedef long long ll;

const long long mod=1000000007;

const int maxn=200005;

ll inv[maxn],s[maxn];

int N,n,m,x,y;

ll Pow(ll a,int b)

{

	ll ans=1;

	while(b)

	{

		if(b&1)

			ans=ans*a%mod;

		a=a*a%mod;

		b>>=1;

	}

	return ans;

}

ll C(int a,int b)

{

	if(a<0||b<0)

		return 1;

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

}

int main()

{

	scanf("%d%d",&n,&m);

    scanf("%d%d",&x,&y);

    N=n+m-2;

    s[0]=1;

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

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

    inv[0]=1;

    inv[N]=Pow(s[N],mod-2);

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

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

    ll ans=0;

    for(int i=y+1;i<=m;i++)

    {

    	ans+=C(n-x+i-2,i-1)*C(x+m-i-1,x-1)%mod;

    	ans%=mod;

	}

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

	return 0;

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



using namespace std;

#define REPP(i,a,b,c) for(int i=a; i<=b; i+=c)

#define REP(i,a,b) REPP(i,a,b,1)

#define REVV(i,a,b,c) for(int i=a; i>=b; i-=c)

#define REV(i,a,b) REVV(i,a,b,1)

#define FOR(i,a) REP(i,0,(int)a-1)

#define FORD(i,a) REV(i,(int)a-1,0)

#define MP make_pair

#define PB push_back

#define POB pop_back

#define FI first

#define SE second

typedef long long ll;

typedef unsigned long long ull;

typedef pair < int , int > pii;

typedef vector < int > vi;

typedef vector < pii > vii;

typedef vector < ll > vl;



const double PI = acos(-1);

const double EPS = 1e-9;

const int INF = 1e9;

const ll MOD = 1e9 + 7;



///////////////////////////////////////////////////////



const int N = 1e5;



ll h,w,a,b;

ll fact[2*N + 5];

ll addMod(ll a, ll b){

	return (a +b ) % MOD;

}



ll mulMod(ll a, ll b){

	return (a*b) % MOD;

}



ll fast(ll a, ll b){

	if(b == 0) return 1;

	ll tmp = fast(a,b/2);

	tmp = mulMod(tmp,tmp);

	if(b % 2 == 1) tmp = mulMod(tmp,a);

	return tmp;

}



ll combin(int n, int k){

	return mulMod(fact[n], fast(mulMod(fact[n-k], fact[k]), MOD-2));

}



ll solve(){

	ll ret = 0;

	REP(i,1,h-a){

		int y = i;

		int x = b;

		ll val = combin(y+x-2,y-1);

		x++;

		val = mulMod(val, combin(h+w-y-x, h-y));

		ret = addMod(ret, val);

	}

	return ret;

}



int main(){

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

	fact[0] = 1;

	REP(i,1,2*N) fact[i] = mulMod(fact[i-1], i);

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

	cout << solve() << endl;

	return 0;

} 

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

#include<cstdio>

#include<cstring>

#include<cmath>

#include<algorithm>

using namespace std;

typedef long long ll;

const long long mod=1000000007;

const int maxn=200005;

ll inv[maxn],s[maxn];

int N,n,m,x,y;

ll Pow(ll a,int b)

{

	ll ans=1;

	while(b)

	{

		if(b&1)

			ans=ans*a%mod;

		a=a*a%mod;

		b>>=1;

	}

	return ans;

}

ll C(int a,int b)

{

	if(a<0||b<0)

		return 1;

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

}

int main()

{

	scanf("%d%d",&n,&m);

    scanf("%d%d",&x,&y);

    N=n+m-2;

    s[0]=1;

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

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

    inv[0]=1;

    inv[N]=Pow(s[N],mod-2);

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

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

    ll ans=0;

    for(int i=y+1;i<=m;i++)

    {

    	ans+=C(n-x+i-2,i-1)*C(x+m-i-1,x-1)%mod;

    	ans%=mod;

	}

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

	return 0;

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



#define LL long long

#define RG register



using namespace std;

template<class T> inline void read(T &x) {

	x = 0; RG char c = getchar(); bool f = 0;

	while (c != '-' && (c < '0' || c > '9')) c = getchar(); if (c == '-') c = getchar(), f = 1;

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

	x = f ? -x : x;

	return ;

}

template<class T> inline void write(T x) {

	if (!x) {putchar(48);return ;}

	if (x < 0) x = -x, putchar('-');

	int len = -1, z[20]; while (x > 0) z[++len] = x%10, x /= 10;

	for (RG int i = len; i >= 0; i--) putchar(z[i]+48);return ;

}

const int N = 200010, Mod = 1e9 + 7;

int fac[N], ifac[N], H, W, A, B;

int fpow(int a, int b) {

	int res = 1;

	for (; b; b >>= 1, a = 1ll * a * a % Mod)

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

	return res;

}

int C(int n, int m) {

	if (n < m) return 0;

	return 1ll * fac[n] * ifac[m] % Mod * ifac[n - m] % Mod;

}

int calc(int n, int m) {

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

}

int main() {

	//freopen(".in", "r", stdin);

	//freopen(".out", "w", stdout);

	read(H), read(W), read(A), read(B);

	fac[0] = 1;

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

		fac[i] = 1ll * fac[i - 1] * i % Mod;

	ifac[200000] = fpow(fac[200000], Mod - 2);

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

		ifac[i - 1] = 1ll * ifac[i] * i % Mod;

	int ans = 0;

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

		(ans += 1ll * calc(H - A, i) * calc(A, W - i + 1) % Mod) %= Mod;

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

	return 0;

}


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

#include<cstdio>

#include<cstring>

#include<cmath>

#include<algorithm>

using namespace std;

typedef long long ll;

const long long mod=1000000007;

const int maxn=200005;

ll inv[maxn],s[maxn];

int N,n,m,x,y;

ll Pow(ll a,int b)

{

	ll ans=1;

	while(b)

	{

		if(b&1)

			ans=ans*a%mod;

		a=a*a%mod;

		b>>=1;

	}

	return ans;

}

ll C(int a,int b)

{

	if(a<0||b<0)

		return 1;

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

}

int main()

{

	scanf("%d%d",&n,&m);

    scanf("%d%d",&x,&y);

    N=n+m-2;

    s[0]=1;

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

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

    inv[0]=1;

    inv[N]=Pow(s[N],mod-2);

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

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

    ll ans=0;

    for(int i=y+1;i<=m;i++)

    {

    	ans+=C(n-x+i-2,i-1)*C(x+m-i-1,x-1)%mod;

    	ans%=mod;

	}

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

	return 0;

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

#include <cstdio>

#include <cstring>

#define int long long

#define fre(x) freopen(x".in","r",stdin),freopen(x".out","w",stdout)

using namespace std;



inline int read(){

	int sum=0,f=1;char ch=getchar();

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

	while(ch>='0'&&ch<='9'){sum=sum*10+ch-'0';ch=getchar();}

	return f*sum;

}



const int N=200055;

const int Mod=1000000007;

int n,m,A,B,ans,jc[N]={1};



inline int fpow(int a,int b){

	int ret=1;

	for(;b;b>>=1,a=a*a%Mod) if(b&1) ret=ret*a%Mod;

	return ret;

}



inline int inv(int x){

	return fpow(x,Mod-2);

}



inline int C(int n,int m){

	return jc[n]*inv(jc[m])%Mod*inv(jc[n-m])%Mod;

}



inline int get(int x1,int y1,int x2,int y2){

	int x=x2-x1+1,y=y2-y1+1;

	return C(x+y-2,y-1);

}



signed main(){

	n=read();m=read();A=read();B=read();

	for(int i=1;i<N;i++) jc[i]=jc[i-1]*i%Mod;

	int x=n-A,y=B+1;

	while(x&&y<=m){

		ans=(ans+get(1,1,x,y)*get(x,y,n,m)%Mod)%Mod;

		x--;y++;

	}

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

	return 0;

}


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

#include<cstdio>

#include<cstring>

#include<cmath>

#include<algorithm>

using namespace std;

typedef long long ll;

const long long mod=1000000007;

const int maxn=200005;

ll inv[maxn],s[maxn];

int N,n,m,x,y;

ll Pow(ll a,int b)

{

	ll ans=1;

	while(b)

	{

		if(b&1)

			ans=ans*a%mod;

		a=a*a%mod;

		b>>=1;

	}

	return ans;

}

ll C(int a,int b)

{

	if(a<0||b<0)

		return 1;

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

}

int main()

{

	scanf("%d%d",&n,&m);

    scanf("%d%d",&x,&y);

    N=n+m-2;

    s[0]=1;

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

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

    inv[0]=1;

    inv[N]=Pow(s[N],mod-2);

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

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

    ll ans=0;

    for(int i=y+1;i<=m;i++)

    {

    	ans+=C(n-x+i-2,i-1)*C(x+m-i-1,x-1)%mod;

    	ans%=mod;

	}

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

	return 0;

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

#define ll long long

using namespace std;

inline int read(){

	int x=0,f=1;char c=getchar();

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

	while ('0'<=c&&c<='9') x=(x<<1)+(x<<3)+(c^48),c=getchar();

	return x*f;

}

const int mod(1e9+7),maxn(2e5+5);

int h,w,a,b;

ll fac[maxn],inv[maxn];

ll ans;

ll qpow(ll a,ll b){

	ll sum=1;

	while (b){

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

		a=a*a%mod;

		b>>=1;

	}

	return sum;

}

void pre(){

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

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

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

	for (int i(199999);i;--i) inv[i]=1ll*inv[i+1]*(i+1)%mod;

}

void init(){

	h=read(),w=read(),a=read(),b=read();

}

inline ll cal(int x1,int y1,int x2,int y2){

	int n=x2-x1+y2-y1,m=x2-x1;

	if (n==m||m==0) return 1;

	return 1ll*fac[n]*inv[m]%mod*inv[n-m]%mod;

}

int main(){

	pre();

	init();

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

		ans=(ans+cal(1,1,i,b)*cal(i,b+1,h,w)%mod)%mod;

	printf("%lld",ans);

	return 0;

}


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

#include<cstdio>

#include<cstring>

#include<cmath>

#include<algorithm>

using namespace std;

typedef long long ll;

const long long mod=1000000007;

const int maxn=200005;

ll inv[maxn],s[maxn];

int N,n,m,x,y;

ll Pow(ll a,int b)

{

	ll ans=1;

	while(b)

	{

		if(b&1)

			ans=ans*a%mod;

		a=a*a%mod;

		b>>=1;

	}

	return ans;

}

ll C(int a,int b)

{

	if(a<0||b<0)

		return 1;

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

}

int main()

{

	scanf("%d%d",&n,&m);

    scanf("%d%d",&x,&y);

    N=n+m-2;

    s[0]=1;

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

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

    inv[0]=1;

    inv[N]=Pow(s[N],mod-2);

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

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

    ll ans=0;

    for(int i=y+1;i<=m;i++)

    {

    	ans+=C(n-x+i-2,i-1)*C(x+m-i-1,x-1)%mod;

    	ans%=mod;

	}

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

	return 0;

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



#define LL long long

#define RG register



using namespace std;

template<class T> inline void read(T &x) {

	x = 0; RG char c = getchar(); bool f = 0;

	while (c != '-' && (c < '0' || c > '9')) c = getchar(); if (c == '-') c = getchar(), f = 1;

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

	x = f ? -x : x;

	return ;

}

template<class T> inline void write(T x) {

	if (!x) {putchar(48);return ;}

	if (x < 0) x = -x, putchar('-');

	int len = -1, z[20]; while (x > 0) z[++len] = x%10, x /= 10;

	for (RG int i = len; i >= 0; i--) putchar(z[i]+48);return ;

}

const int N = 200010, Mod = 1e9 + 7;

int fac[N], ifac[N], H, W, A, B;

int fpow(int a, int b) {

	int res = 1;

	for (; b; b >>= 1, a = 1ll * a * a % Mod)

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

	return res;

}

int C(int n, int m) {

	if (n < m) return 0;

	return 1ll * fac[n] * ifac[m] % Mod * ifac[n - m] % Mod;

}

int calc(int n, int m) {

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

}

int main() {

	//freopen(".in", "r", stdin);

	//freopen(".out", "w", stdout);

	read(H), read(W), read(A), read(B);

	fac[0] = 1;

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

		fac[i] = 1ll * fac[i - 1] * i % Mod;

	ifac[200000] = fpow(fac[200000], Mod - 2);

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

		ifac[i - 1] = 1ll * ifac[i] * i % Mod;

	int ans = 0;

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

		(ans += 1ll * calc(H - A, i) * calc(A, W - i + 1) % Mod) %= Mod;

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

	return 0;

}


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

using namespace std;



const int maxn=2e5+5;

const int mod=1000000007;

long long fac[maxn];



int qpow(long long a,long long b){

	long long ret=1;

	while(b){

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

		a=a*a%mod;

		b>>=1;

	}

	return ret;

}



int C(int n,int m){

	return (long long)fac[n]*qpow(fac[m],mod-2)%mod*qpow(fac[n-m],mod-2)%mod;

}



int f(int n,int m){

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

}



int main(){

	int h,w,a,b;

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

	fac[0]=1;

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

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

	}

	int ret=0;

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

		ret=(ret+(long long)f(i,b)*f(h-i+1,w-b))%mod;

	}

	cout<<ret;

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

#define ll long long

using namespace std;

inline int read(){

	int x=0,f=1;char c=getchar();

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

	while ('0'<=c&&c<='9') x=(x<<1)+(x<<3)+(c^48),c=getchar();

	return x*f;

}

const int mod(1e9+7),maxn(2e5+5);

int h,w,a,b;

ll fac[maxn],inv[maxn];

ll ans;

ll qpow(ll a,ll b){

	ll sum=1;

	while (b){

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

		a=a*a%mod;

		b>>=1;

	}

	return sum;

}

void pre(){

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

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

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

	for (int i(199999);i;--i) inv[i]=1ll*inv[i+1]*(i+1)%mod;

}

void init(){

	h=read(),w=read(),a=read(),b=read();

}

inline ll cal(int x1,int y1,int x2,int y2){

	int n=x2-x1+y2-y1,m=x2-x1;

	if (n==m||m==0) return 1;

	return 1ll*fac[n]*inv[m]%mod*inv[n-m]%mod;

}

int main(){

	pre();

	init();

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

		ans=(ans+cal(1,1,i,b)*cal(i,b+1,h,w)%mod)%mod;

	printf("%lld",ans);

	return 0;

}


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

using namespace std;



const int maxn=2e5+5;

const int mod=1000000007;

long long fac[maxn];



int qpow(long long a,long long b){

	long long ret=1;

	while(b){

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

		a=a*a%mod;

		b>>=1;

	}

	return ret;

}



int C(int n,int m){

	return (long long)fac[n]*qpow(fac[m],mod-2)%mod*qpow(fac[n-m],mod-2)%mod;

}



int f(int n,int m){

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

}



int main(){

	int h,w,a,b;

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

	fac[0]=1;

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

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

	}

	int ret=0;

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

		ret=(ret+(long long)f(i,b)*f(h-i+1,w-b))%mod;

	}

	cout<<ret;

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

#define ll long long int

using namespace std;



ll mod = 1000000007;



ll fact[200010];





ll power(ll x, ll y, ll p) 

{ 

    ll res = 1;

  

    x = x % p;

  

    while (y > 0) 

    {

        if (y & 1) 

            res = (res*x) % p;

        y = y>>1;

        x = (x*x) % p; 

    } 

    return res; 

} 

  

// Returns n^(-1) mod p 

ll modInverse(ll n, ll p) 

{ 

    return power(n, p-2, p); 

}



void init(){



    fact[0] = 1;



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

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

	}

}



ll sol(ll r, ll d){

    ll ans = fact[r+d];

    ans = (ans*modInverse(fact[r],mod))%mod;

    ans = (ans*modInverse(fact[d],mod))%mod;

    

    return ans;

}



int main() {

    init();

    int h,w,a,b;

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

    

    ll ans = 0;

    ll t;

    

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

        t = 1;

        t = (t*sol(i,b-1))%mod;

        t = (t*sol(w-b-1,h-i-1))%mod;

        // cout<<i<<":"<<b<<" "<<w-b-1<<":"<<h-i-1<<'\n';

        ans = (ans + t)%mod;

    }

    

    cout<<ans;

    

    return 0;

}












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

using namespace std;



const int maxn=2e5+5;

const int mod=1000000007;

long long fac[maxn];



int qpow(long long a,long long b){

	long long ret=1;

	while(b){

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

		a=a*a%mod;

		b>>=1;

	}

	return ret;

}



int C(int n,int m){

	return (long long)fac[n]*qpow(fac[m],mod-2)%mod*qpow(fac[n-m],mod-2)%mod;

}



int f(int n,int m){

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

}



int main(){

	int h,w,a,b;

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

	fac[0]=1;

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

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

	}

	int ret=0;

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

		ret=(ret+(long long)f(i,b)*f(h-i+1,w-b))%mod;

	}

	cout<<ret;

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



#define LL long long

#define RG register



using namespace std;

template<class T> inline void read(T &x) {

	x = 0; RG char c = getchar(); bool f = 0;

	while (c != '-' && (c < '0' || c > '9')) c = getchar(); if (c == '-') c = getchar(), f = 1;

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

	x = f ? -x : x;

	return ;

}

template<class T> inline void write(T x) {

	if (!x) {putchar(48);return ;}

	if (x < 0) x = -x, putchar('-');

	int len = -1, z[20]; while (x > 0) z[++len] = x%10, x /= 10;

	for (RG int i = len; i >= 0; i--) putchar(z[i]+48);return ;

}

const int N = 200010, Mod = 1e9 + 7;

int fac[N], ifac[N], H, W, A, B;

int fpow(int a, int b) {

	int res = 1;

	for (; b; b >>= 1, a = 1ll * a * a % Mod)

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

	return res;

}

int C(int n, int m) {

	if (n < m) return 0;

	return 1ll * fac[n] * ifac[m] % Mod * ifac[n - m] % Mod;

}

int calc(int n, int m) {

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

}

int main() {

	//freopen(".in", "r", stdin);

	//freopen(".out", "w", stdout);

	read(H), read(W), read(A), read(B);

	fac[0] = 1;

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

		fac[i] = 1ll * fac[i - 1] * i % Mod;

	ifac[200000] = fpow(fac[200000], Mod - 2);

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

		ifac[i - 1] = 1ll * ifac[i] * i % Mod;

	int ans = 0;

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

		(ans += 1ll * calc(H - A, i) * calc(A, W - i + 1) % Mod) %= Mod;

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

	return 0;

}


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

using namespace std;

typedef long long ll;

typedef unsigned long long ull;

const int mod=7+1e9;

ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}

ll lcm(ll x,ll y){return x/gcd(x,y)*y;}

ll qpow(ll a,ll b,ll p){a%=p; ll ret=1;for(;b;b>>=1,a=a*a%p) if(b&1) ret=ret*a%p; return ret;}

ll getInv(ll x,ll p){return qpow(x,p-2,p);}

const int N=5+2e5;

ll n[N];

ll C(ll a,ll b){ return n[a]*getInv(n[b]*n[a-b]%mod,mod)%mod;}

int main(){

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

    n[0]=1;

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

    ll ans=0;

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

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

    ans=(ans+mod)%mod;

    cout<<ans<<'\n';

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

#define ll long long

using namespace std;

inline int read(){

	int x=0,f=1;char c=getchar();

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

	while ('0'<=c&&c<='9') x=(x<<1)+(x<<3)+(c^48),c=getchar();

	return x*f;

}

const int mod(1e9+7),maxn(2e5+5);

int h,w,a,b;

ll fac[maxn],inv[maxn];

ll ans;

ll qpow(ll a,ll b){

	ll sum=1;

	while (b){

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

		a=a*a%mod;

		b>>=1;

	}

	return sum;

}

void pre(){

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

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

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

	for (int i(199999);i;--i) inv[i]=1ll*inv[i+1]*(i+1)%mod;

}

void init(){

	h=read(),w=read(),a=read(),b=read();

}

inline ll cal(int x1,int y1,int x2,int y2){

	int n=x2-x1+y2-y1,m=x2-x1;

	if (n==m||m==0) return 1;

	return 1ll*fac[n]*inv[m]%mod*inv[n-m]%mod;

}

int main(){

	pre();

	init();

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

		ans=(ans+cal(1,1,i,b)*cal(i,b+1,h,w)%mod)%mod;

	printf("%lld",ans);

	return 0;

}


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

using namespace std;

typedef long long ll;

typedef unsigned long long ull;

const int mod=7+1e9;

ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}

ll lcm(ll x,ll y){return x/gcd(x,y)*y;}

ll qpow(ll a,ll b,ll p){a%=p; ll ret=1;for(;b;b>>=1,a=a*a%p) if(b&1) ret=ret*a%p; return ret;}

ll getInv(ll x,ll p){return qpow(x,p-2,p);}

const int N=5+2e5;

ll n[N];

ll C(ll a,ll b){ return n[a]*getInv(n[b]*n[a-b]%mod,mod)%mod;}

int main(){

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

    n[0]=1;

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

    ll ans=0;

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

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

    ans=(ans+mod)%mod;

    cout<<ans<<'\n';

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

#define ll long long int

using namespace std;



ll mod = 1000000007;



ll fact[200010];





ll power(ll x, ll y, ll p) 

{ 

    ll res = 1;

  

    x = x % p;

  

    while (y > 0) 

    {

        if (y & 1) 

            res = (res*x) % p;

        y = y>>1;

        x = (x*x) % p; 

    } 

    return res; 

} 

  

// Returns n^(-1) mod p 

ll modInverse(ll n, ll p) 

{ 

    return power(n, p-2, p); 

}



void init(){



    fact[0] = 1;



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

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

	}

}



ll sol(ll r, ll d){

    ll ans = fact[r+d];

    ans = (ans*modInverse(fact[r],mod))%mod;

    ans = (ans*modInverse(fact[d],mod))%mod;

    

    return ans;

}



int main() {

    init();

    int h,w,a,b;

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

    

    ll ans = 0;

    ll t;

    

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

        t = 1;

        t = (t*sol(i,b-1))%mod;

        t = (t*sol(w-b-1,h-i-1))%mod;

        // cout<<i<<":"<<b<<" "<<w-b-1<<":"<<h-i-1<<'\n';

        ans = (ans + t)%mod;

    }

    

    cout<<ans;

    

    return 0;

}












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

using namespace std;

typedef long long ll;

typedef unsigned long long ull;

const int mod=7+1e9;

ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}

ll lcm(ll x,ll y){return x/gcd(x,y)*y;}

ll qpow(ll a,ll b,ll p){a%=p; ll ret=1;for(;b;b>>=1,a=a*a%p) if(b&1) ret=ret*a%p; return ret;}

ll getInv(ll x,ll p){return qpow(x,p-2,p);}

const int N=5+2e5;

ll n[N];

ll C(ll a,ll b){ return n[a]*getInv(n[b]*n[a-b]%mod,mod)%mod;}

int main(){

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

    n[0]=1;

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

    ll ans=0;

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

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

    ans=(ans+mod)%mod;

    cout<<ans<<'\n';

}