stablegradients/pie-gem5-pairs huggingface dataset:
// 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: 1.7658250144059948x):
#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;

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

#include<algorithm>

using namespace std;

#define MO 1000000007

#define MAXN 200005

#define LL long long

LL inv[MAXN],s[MAXN];

int n;

LL PowMod(LL a,int b) {

    LL ret=1;

    while(b) {

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

        a=a*a%MO;

        b>>=1;

    }

    return ret;

}

void Pre() {

    s[0]=1;

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

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

    inv[0]=1;

    inv[n]=PowMod(s[n],MO-2);

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

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

}

LL C(int a,int b) {

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

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

}

int main() {

    int h,w,A,B;

    scanf("%d%d%d%d",&h,&w,&A,&B);

    n=h+w-2;

    Pre();

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

        ans=(ans%MO+MO)%MO;

    }

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

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

}

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

#include<algorithm>

using namespace std;

#define MO 1000000007

#define MAXN 200005

#define LL long long

LL inv[MAXN],s[MAXN];

int n;

LL PowMod(LL a,int b) {

    LL ret=1;

    while(b) {

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

        a=a*a%MO;

        b>>=1;

    }

    return ret;

}

void Pre() {

    s[0]=1;

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

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

    inv[0]=1;

    inv[n]=PowMod(s[n],MO-2);

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

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

}

LL C(int a,int b) {

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

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

}

int main() {

    int h,w,A,B;

    scanf("%d%d%d%d",&h,&w,&A,&B);

    n=h+w-2;

    Pre();

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

        ans=(ans%MO+MO)%MO;

    }

    printf("%lld\n",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);

}

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

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

#include<algorithm>

using namespace std;

#define MOD 1000000007

#define MAXN 200005

#define LL long long

LL inv[MAXN],s[MAXN];

int N;

int H,W,A,B;

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;

}

void Pre() 

{

    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 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 %d %d",&H,&W,&A,&B);

	N=H+W-2;

	Pre();

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

	}

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

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

}

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

#include<algorithm>

using namespace std;

#define MOD 1000000007

#define MAXN 200005

#define LL long long

LL inv[MAXN],s[MAXN];

int N;

int H,W,A,B;

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;

}

void Pre() 

{

    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 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 %d %d",&H,&W,&A,&B);

	N=H+W-2;

	Pre();

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

	}

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

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

}

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

#include<algorithm>

using namespace std;

#define MOD 1000000007

#define MAXN 200005

#define LL long long

LL inv[MAXN],s[MAXN];

int N;

int H,W,A,B;

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;

}

void Pre() 

{

    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 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 %d %d",&H,&W,&A,&B);

	N=H+W-2;

	Pre();

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

	}

    printf("%lld\n",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);

}

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

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

}

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

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

}

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

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

}

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

using namespace std;

#define int long long

int ll[200007],ff[200007];

const int mod = 1e9 + 7;



int qpow(int a,int b){

  int ret=1;

  while(b){

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

    a=(a*a)%mod;

    b>>=1;

  }

  return ret;

}





int cc(int n,int m){

  return (ff[n]*ll[m])%mod*ll[n-m]%mod;

}



int count_ways(int a,int b,int c,int d){

  int tot=(c-a)+(d-b);

  int down=(c-a);

  int ret=cc(tot,down);

  return ret;

}

main()

{

	

	int n,m,a,b;

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

	ff[0]=1; ll[0]=1;

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

	{

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

    ll[i]=qpow(ff[i],mod-2);

    }

	int tot=count_ways(1,1,n,m);

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

	{

        int tmp=count_ways(1,1,n-a,i)*count_ways(n-a+1,i,n,m)%mod;

        tot=(tot-tmp+mod)%mod;

    }

    cout<<tot<<endl;

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

}

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

using namespace std;

typedef long long LL;

#define MAXN 200000

const int MOD = 1000000007;

int n, m, a, b, fac[MAXN+50]={1}, inv[MAXN+50]={1, 1};

inline int C(int n, int m)

{

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

}

int main()

{

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

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

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

    for(int i=2; i<=n+m+5; i++)

		inv[i] = (LL)(MOD-MOD/i) * inv[MOD%i] % MOD;

	for(int i=2; i<=n+m+5; i++)

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

    int ans=0;

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

		ans += (LL)C(i+b-2,b-1) * C(n-i+m-b-1,n-i)%MOD,

		ans %= MOD;

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

    return 0;

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

}

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

}