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

}

//yyyyyyy

// Faster C++ solution for the same problem (measured speedup: 16.558945870026225x):
#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%2==1)

			ret=ret*a%MO;

		a=a*a%MO;

		b/=2;

	}

	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)//组合C

{

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

	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.377350702840825x):
#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%2==1)

			ret=ret*a%MO;

		a=a*a%MO;

		b/=2;

	}

	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)//组合C

{

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

	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.52140406586046x):
#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);

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

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

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

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

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

}
// 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.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);

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

}
// 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.549515204581766x):
#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 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.225717472368927x):
#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;

}