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

#define int long long

#define rg register

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

using namespace std;

const int N=200000+10;

const int mod=1e9+7;

int read(){

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

    while(c<'0'||c>'9') f=(c=='-')?-1:1,c=getchar();

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

    return f*x;

}

int inv[N],jc[N];

int ksm(int a,int b){

	int ans=1;

	while(b){

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

		a=a*a%mod;

		b>>=1;

	}

	return ans;

}

int C(int n,int m){

	return jc[n]*inv[m]%mod*inv[n-m]%mod;

}

int calc(int x,int y,int X,int Y){

	int n=abs(X-x),m=abs(Y-y);

	return C(n+m,n);

}

main(){

    //file("");

	jc[0]=1;

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

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

	inv[N-10]=ksm(jc[N-10],mod-2);

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

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

	int H=read(),W=read(),A=read(),B=read(),ans=calc(1,1,H,W);

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

		ans=(ans-calc(1,1,i,B)*calc(i,B+1,H,W)%mod+mod)%mod;

	cout<<ans;

    return 0;

}


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



using namespace std;



const int maxn=200000+5;

const int mod=1000000007;



int h,w,a,b;

int fac[maxn];



void exgcd(int a,int b,int &g,int &x,int &y)

{

	if(b==0)g=a,x=1,y=0;

	else exgcd(b,a%b,g,y,x),y-=a/b*x;

}



int inv(int a)

{

	int g,x,y;

	exgcd(a,mod,g,x,y);

	return(x+mod)%mod;

}



int C(int n,int m)

{

	return (long long)fac[n]*inv(fac[m])%mod*inv(fac[n-m])%mod;

}



int f(int n,int m)

{

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

}



int main()

{

	fac[0]=1;

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

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

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

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

using namespace std;

typedef long long ll;

typedef unsigned long long ull;

typedef pair<ll, int> pii;

#define f(i, l, r) for (int i = l; i <= r; i++)

#define rf(i, r, l) for (int i = r; i >= l; i--)

#define all(x) (x).begin(), (x).end()

#define sf(a) scanf("%d",&a)

#define llsf(a) scanf("%lld", &a)

#define l l

#define r r

#define lch (o << 1)

#define rch (o << 1 | 1)

#define mid ((l + r) >> 1)

#define mem(x, y) memset(x, y, sizeof(x))



const int inf = 2e9 + 7;

const ll INF = INT64_MAX;

double eps = 1e-6;

int mod = 1e9 + 7;

const int N = 1e6 + 10;

const double pi = acos(-1.0);



ll f[N];

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

	ll c;

	return !b ? (x = 1, y = 0, a) : (c = exgcd(b, a % b, y, x), y -= (a / b) * x, c);

}

ll C(int a,int b) {

	if (a > b)swap(a, b);

	b = a + b - 2; a = a - 1;

	ll x, y; exgcd(f[a] * f[b - a] % mod, mod, x, y); if (x < 0)x += mod;

	return f[b] * x % mod;

}

int main() {

#ifdef local

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

#endif

	f[0] = 1;

	f(i, 1, 2e5)f[i] = f[i - 1] * i % mod;

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

	ll res = 0;

	f(i, 1, h - a) {

		res = (res + C(i, b + 1) * C(h - i + 1, w - b-1) % mod) % mod;

	}

	res = (res + C(h-a,b+1)*C(a,w-b)%mod) % mod;

	cout << res;

}

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



using namespace std;



const int maxn=200000+5;

const int mod=1000000007;



int h,w,a,b;

int fac[maxn];



void exgcd(int a,int b,int &g,int &x,int &y)

{

	if(b==0)g=a,x=1,y=0;

	else exgcd(b,a%b,g,y,x),y-=a/b*x;

}



int inv(int a)

{

	int g,x,y;

	exgcd(a,mod,g,x,y);

	return(x+mod)%mod;

}



int C(int n,int m)

{

	return (long long)fac[n]*inv(fac[m])%mod*inv(fac[n-m])%mod;

}



int f(int n,int m)

{

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

}



int main()

{

	fac[0]=1;

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

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

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

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

#include <cstdio>

#include <algorithm>

#include <cstring>

using namespace std;

typedef long long LL;

LL mod = 1e9 + 7;

LL f[200005];

LL qpow(LL x, LL n)

{

    LL res = 1, p = x;

    while(n)

    {

        if(n & 1)

            res = res*p%mod;

        p = p*p%mod;

        n >>= 1;

    }

    return res;

}



LL C(LL x, LL y)

{

    LL a = f[x], b = f[y]*f[x-y]%mod;

    return a*qpow(b, mod - 2)%mod;

}

int main()

{

    f[0] = 1;

    for(int i = 1; i < 2e5+5; i++)

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

    LL h, w, a, b;

    while(~scanf("%lld%lld%lld%lld", &h, &w, &a, &b))

    {

        LL ans = 0;

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

        {

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

        }

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

    }

    return 0;

}


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



using namespace std;



const int maxn=200000+5;

const int mod=1000000007;



int h,w,a,b;

int fac[maxn];



void exgcd(int a,int b,int &g,int &x,int &y)

{

	if(b==0)g=a,x=1,y=0;

	else exgcd(b,a%b,g,y,x),y-=a/b*x;

}



int inv(int a)

{

	int g,x,y;

	exgcd(a,mod,g,x,y);

	return(x+mod)%mod;

}



int C(int n,int m)

{

	return (long long)fac[n]*inv(fac[m])%mod*inv(fac[n-m])%mod;

}



int f(int n,int m)

{

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

}



int main()

{

	fac[0]=1;

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

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

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

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

#define int long long

#define rg register

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

using namespace std;

const int N=200000+10;

const int mod=1e9+7;

int read(){

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

    while(c<'0'||c>'9') f=(c=='-')?-1:1,c=getchar();

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

    return f*x;

}

int inv[N],jc[N];

int ksm(int a,int b){

	int ans=1;

	while(b){

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

		a=a*a%mod;

		b>>=1;

	}

	return ans;

}

int C(int n,int m){

	return jc[n]*inv[m]%mod*inv[n-m]%mod;

}

int calc(int x,int y,int X,int Y){

	int n=abs(X-x),m=abs(Y-y);

	return C(n+m,n);

}

main(){

    //file("");

	jc[0]=1;

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

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

	inv[N-10]=ksm(jc[N-10],mod-2);

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

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

	int H=read(),W=read(),A=read(),B=read(),ans=calc(1,1,H,W);

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

		ans=(ans-calc(1,1,i,B)*calc(i,B+1,H,W)%mod+mod)%mod;

	cout<<ans;

    return 0;

}


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

using namespace std;

const int maxn = 2e5+5;

const int mod = 1e9+7;



int h,w,a,b;

long long ret;

int fac[maxn];



void exgcd(int a, int b, int &g, int &x, int &y) {

	if (b == 0) g = a, x = 1, y = 0;

	else exgcd(b,a%b,g,y,x), y -= a/b*x;

}



int inv(int a) {

	int g,x,y;

	exgcd(a, mod, g, x, y);

	return (x+mod) % mod;

}



int C(int n,int m) {

	return (long long)fac[n] * inv(fac[m]) % mod * inv(fac[n-m]) % mod;

}



int f(int n, int m) {

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

}



int main() {

	fac[0] = 1;

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

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

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

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

	}

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

	return 0;

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

using namespace std;

typedef long long ll;

typedef unsigned long long ull;

typedef pair<ll, int> pii;

#define f(i, l, r) for (int i = l; i <= r; i++)

#define rf(i, r, l) for (int i = r; i >= l; i--)

#define all(x) (x).begin(), (x).end()

#define sf(a) scanf("%d",&a)

#define llsf(a) scanf("%lld", &a)

#define l l

#define r r

#define lch (o << 1)

#define rch (o << 1 | 1)

#define mid ((l + r) >> 1)

#define mem(x, y) memset(x, y, sizeof(x))



const int inf = 2e9 + 7;

const ll INF = INT64_MAX;

double eps = 1e-6;

int mod = 1e9 + 7;

const int N = 1e6 + 10;

const double pi = acos(-1.0);



ll f[N];

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

	ll c;

	return !b ? (x = 1, y = 0, a) : (c = exgcd(b, a % b, y, x), y -= (a / b) * x, c);

}

ll C(int a,int b) {

	if (a > b)swap(a, b);

	b = a + b - 2; a = a - 1;

	ll x, y; exgcd(f[a] * f[b - a] % mod, mod, x, y); if (x < 0)x += mod;

	return f[b] * x % mod;

}

int main() {

#ifdef local

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

#endif

	f[0] = 1;

	f(i, 1, 2e5)f[i] = f[i - 1] * i % mod;

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

	ll res = 0;

	f(i, 1, h - a) {

		res = (res + C(i, b + 1) * C(h - i + 1, w - b-1) % mod) % mod;

	}

	res = (res + C(h-a,b+1)*C(a,w-b)%mod) % mod;

	cout << res;

}

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

using namespace std;

const int maxn = 2e5+5;

const int mod = 1e9+7;



int h,w,a,b;

long long ret;

int fac[maxn];



void exgcd(int a, int b, int &g, int &x, int &y) {

	if (b == 0) g = a, x = 1, y = 0;

	else exgcd(b,a%b,g,y,x), y -= a/b*x;

}



int inv(int a) {

	int g,x,y;

	exgcd(a, mod, g, x, y);

	return (x+mod) % mod;

}



int C(int n,int m) {

	return (long long)fac[n] * inv(fac[m]) % mod * inv(fac[n-m]) % mod;

}



int f(int n, int m) {

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

}



int main() {

	fac[0] = 1;

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

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

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

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

	}

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

	return 0;

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

#include <cstdio>

#include <algorithm>

#include <cstring>

using namespace std;

typedef long long LL;

LL mod = 1e9 + 7;

LL f[200005];

LL qpow(LL x, LL n)

{

    LL res = 1, p = x;

    while(n)

    {

        if(n & 1)

            res = res*p%mod;

        p = p*p%mod;

        n >>= 1;

    }

    return res;

}



LL C(LL x, LL y)

{

    LL a = f[x], b = f[y]*f[x-y]%mod;

    return a*qpow(b, mod - 2)%mod;

}

int main()

{

    f[0] = 1;

    for(int i = 1; i < 2e5+5; i++)

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

    LL h, w, a, b;

    while(~scanf("%lld%lld%lld%lld", &h, &w, &a, &b))

    {

        LL ans = 0;

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

        {

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

        }

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

    }

    return 0;

}


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

using namespace std;

const int maxn = 2e5+5;

const int mod = 1e9+7;



int h,w,a,b;

long long ret;

int fac[maxn];



void exgcd(int a, int b, int &g, int &x, int &y) {

	if (b == 0) g = a, x = 1, y = 0;

	else exgcd(b,a%b,g,y,x), y -= a/b*x;

}



int inv(int a) {

	int g,x,y;

	exgcd(a, mod, g, x, y);

	return (x+mod) % mod;

}



int C(int n,int m) {

	return (long long)fac[n] * inv(fac[m]) % mod * inv(fac[n-m]) % mod;

}



int f(int n, int m) {

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

}



int main() {

	fac[0] = 1;

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

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

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

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

	}

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

	return 0;

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

#define int long long

#define rg register

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

using namespace std;

const int N=200000+10;

const int mod=1e9+7;

int read(){

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

    while(c<'0'||c>'9') f=(c=='-')?-1:1,c=getchar();

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

    return f*x;

}

int inv[N],jc[N];

int ksm(int a,int b){

	int ans=1;

	while(b){

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

		a=a*a%mod;

		b>>=1;

	}

	return ans;

}

int C(int n,int m){

	return jc[n]*inv[m]%mod*inv[n-m]%mod;

}

int calc(int x,int y,int X,int Y){

	int n=abs(X-x),m=abs(Y-y);

	return C(n+m,n);

}

main(){

    //file("");

	jc[0]=1;

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

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

	inv[N-10]=ksm(jc[N-10],mod-2);

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

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

	int H=read(),W=read(),A=read(),B=read(),ans=calc(1,1,H,W);

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

		ans=(ans-calc(1,1,i,B)*calc(i,B+1,H,W)%mod+mod)%mod;

	cout<<ans;

    return 0;

}


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

#include<cstdio>

#include<cstring>

#include<cctype>

#include<algorithm>

#define int long long

using namespace std;

inline int read(){

	int x=0,w=0;char c=getchar();

	while(!isdigit(c))w|=c=='-',c=getchar();

	while(isdigit(c))x=(x<<3)+(x<<1)+(c^48),c=getchar();

	return w?-x:x;

}

namespace star{

	const int maxn=1e5,mod=1e9+7;

	int h,w,a,b;

	inline int fpow(int a,int b){

		int ans=1;

		for(;b;b>>=1,a=a*a%mod)if(b&1)ans=ans*a%mod;

		return ans;

	}

	int mul[maxn*2+10],inv[maxn*2+10];

	inline void pre(int n){

		mul[0]=inv[0]=1;

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

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

		inv[n]=fpow(mul[n],mod-2);

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

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

	}	

	inline int C(int n,int m){

		return mul[n]*inv[n-m]%mod*inv[m]%mod;

	}

	inline void work(){

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

		pre(h+w);

		int ans=0;

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

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

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

	}

}

signed main(){

	star::work();

	return 0;

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

using namespace std;

typedef long long ll;

typedef unsigned long long ull;

typedef pair<ll, int> pii;

#define f(i, l, r) for (int i = l; i <= r; i++)

#define rf(i, r, l) for (int i = r; i >= l; i--)

#define all(x) (x).begin(), (x).end()

#define sf(a) scanf("%d",&a)

#define llsf(a) scanf("%lld", &a)

#define l l

#define r r

#define lch (o << 1)

#define rch (o << 1 | 1)

#define mid ((l + r) >> 1)

#define mem(x, y) memset(x, y, sizeof(x))



const int inf = 2e9 + 7;

const ll INF = INT64_MAX;

double eps = 1e-6;

int mod = 1e9 + 7;

const int N = 1e6 + 10;

const double pi = acos(-1.0);



ll f[N];

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

	ll c;

	return !b ? (x = 1, y = 0, a) : (c = exgcd(b, a % b, y, x), y -= (a / b) * x, c);

}

ll C(int a,int b) {

	if (a > b)swap(a, b);

	b = a + b - 2; a = a - 1;

	ll x, y; exgcd(f[a] * f[b - a] % mod, mod, x, y); if (x < 0)x += mod;

	return f[b] * x % mod;

}

int main() {

#ifdef local

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

#endif

	f[0] = 1;

	f(i, 1, 2e5)f[i] = f[i - 1] * i % mod;

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

	ll res = 0;

	f(i, 1, h - a) {

		res = (res + C(i, b + 1) * C(h - i + 1, w - b-1) % mod) % mod;

	}

	res = (res + C(h-a,b+1)*C(a,w-b)%mod) % mod;

	cout << res;

}

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

#include<cstdio>

#include<cstring>

#include<cctype>

#include<algorithm>

#define int long long

using namespace std;

inline int read(){

	int x=0,w=0;char c=getchar();

	while(!isdigit(c))w|=c=='-',c=getchar();

	while(isdigit(c))x=(x<<3)+(x<<1)+(c^48),c=getchar();

	return w?-x:x;

}

namespace star{

	const int maxn=1e5,mod=1e9+7;

	int h,w,a,b;

	inline int fpow(int a,int b){

		int ans=1;

		for(;b;b>>=1,a=a*a%mod)if(b&1)ans=ans*a%mod;

		return ans;

	}

	int mul[maxn*2+10],inv[maxn*2+10];

	inline void pre(int n){

		mul[0]=inv[0]=1;

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

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

		inv[n]=fpow(mul[n],mod-2);

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

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

	}	

	inline int C(int n,int m){

		return mul[n]*inv[n-m]%mod*inv[m]%mod;

	}

	inline void work(){

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

		pre(h+w);

		int ans=0;

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

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

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

	}

}

signed main(){

	star::work();

	return 0;

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

#include <cstdio>

#include <algorithm>

#include <cstring>

using namespace std;

typedef long long LL;

LL mod = 1e9 + 7;

LL f[200005];

LL qpow(LL x, LL n)

{

    LL res = 1, p = x;

    while(n)

    {

        if(n & 1)

            res = res*p%mod;

        p = p*p%mod;

        n >>= 1;

    }

    return res;

}



LL C(LL x, LL y)

{

    LL a = f[x], b = f[y]*f[x-y]%mod;

    return a*qpow(b, mod - 2)%mod;

}

int main()

{

    f[0] = 1;

    for(int i = 1; i < 2e5+5; i++)

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

    LL h, w, a, b;

    while(~scanf("%lld%lld%lld%lld", &h, &w, &a, &b))

    {

        LL ans = 0;

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

        {

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

        }

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

    }

    return 0;

}


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

#include<cstdio>

#include<cstring>

#include<cctype>

#include<algorithm>

#define int long long

using namespace std;

inline int read(){

	int x=0,w=0;char c=getchar();

	while(!isdigit(c))w|=c=='-',c=getchar();

	while(isdigit(c))x=(x<<3)+(x<<1)+(c^48),c=getchar();

	return w?-x:x;

}

namespace star{

	const int maxn=1e5,mod=1e9+7;

	int h,w,a,b;

	inline int fpow(int a,int b){

		int ans=1;

		for(;b;b>>=1,a=a*a%mod)if(b&1)ans=ans*a%mod;

		return ans;

	}

	int mul[maxn*2+10],inv[maxn*2+10];

	inline void pre(int n){

		mul[0]=inv[0]=1;

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

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

		inv[n]=fpow(mul[n],mod-2);

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

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

	}	

	inline int C(int n,int m){

		return mul[n]*inv[n-m]%mod*inv[m]%mod;

	}

	inline void work(){

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

		pre(h+w);

		int ans=0;

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

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

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

	}

}

signed main(){

	star::work();

	return 0;

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



using namespace std;



const int maxn=200000+5;

const int mod=1000000007;



int h,w,a,b;

int fac[maxn];



void exgcd(int a,int b,int &g,int &x,int &y)

{

	if(b==0)g=a,x=1,y=0;

	else exgcd(b,a%b,g,y,x),y-=a/b*x;

}



int inv(int a)

{

	int g,x,y;

	exgcd(a,mod,g,x,y);

	return(x+mod)%mod;

}



int C(int n,int m)

{

	return (long long)fac[n]*inv(fac[m])%mod*inv(fac[n-m])%mod;

}



int f(int n,int m)

{

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

}



int main()

{

	fac[0]=1;

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

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

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

}

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

#include<cstdio>

#include<cstring>

#include<cctype>

#include<algorithm>

#define int long long

using namespace std;

inline int read(){

	int x=0,w=0;char c=getchar();

	while(!isdigit(c))w|=c=='-',c=getchar();

	while(isdigit(c))x=(x<<3)+(x<<1)+(c^48),c=getchar();

	return w?-x:x;

}

namespace star{

	const int maxn=1e5,mod=1e9+7;

	int h,w,a,b;

	inline int fpow(int a,int b){

		int ans=1;

		for(;b;b>>=1,a=a*a%mod)if(b&1)ans=ans*a%mod;

		return ans;

	}

	int mul[maxn*2+10],inv[maxn*2+10];

	inline void pre(int n){

		mul[0]=inv[0]=1;

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

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

		inv[n]=fpow(mul[n],mod-2);

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

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

	}	

	inline int C(int n,int m){

		return mul[n]*inv[n-m]%mod*inv[m]%mod;

	}

	inline void work(){

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

		pre(h+w);

		int ans=0;

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

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

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

	}

}

signed main(){

	star::work();

	return 0;

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

using namespace std;

const int maxn = 2e5+5;

const int mod = 1e9+7;



int h,w,a,b;

long long ret;

int fac[maxn];



void exgcd(int a, int b, int &g, int &x, int &y) {

	if (b == 0) g = a, x = 1, y = 0;

	else exgcd(b,a%b,g,y,x), y -= a/b*x;

}



int inv(int a) {

	int g,x,y;

	exgcd(a, mod, g, x, y);

	return (x+mod) % mod;

}



int C(int n,int m) {

	return (long long)fac[n] * inv(fac[m]) % mod * inv(fac[n-m]) % mod;

}



int f(int n, int m) {

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

}



int main() {

	fac[0] = 1;

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

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

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

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

	}

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

	return 0;

}

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

#include<cstdio>

#include<cstring>

#include<cctype>

#include<algorithm>

#define int long long

using namespace std;

inline int read(){

	int x=0,w=0;char c=getchar();

	while(!isdigit(c))w|=c=='-',c=getchar();

	while(isdigit(c))x=(x<<3)+(x<<1)+(c^48),c=getchar();

	return w?-x:x;

}

namespace star{

	const int maxn=1e5,mod=1e9+7;

	int h,w,a,b;

	inline int fpow(int a,int b){

		int ans=1;

		for(;b;b>>=1,a=a*a%mod)if(b&1)ans=ans*a%mod;

		return ans;

	}

	int mul[maxn*2+10],inv[maxn*2+10];

	inline void pre(int n){

		mul[0]=inv[0]=1;

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

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

		inv[n]=fpow(mul[n],mod-2);

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

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

	}	

	inline int C(int n,int m){

		return mul[n]*inv[n-m]%mod*inv[m]%mod;

	}

	inline void work(){

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

		pre(h+w);

		int ans=0;

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

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

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

	}

}

signed main(){

	star::work();

	return 0;

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

#define re register

#define ll long long

using namespace std;

inline int read(){

	int k=1,sum=0;

	char c=getchar();

	for(;c<'0' || c>'9';c=getchar()) if(c=='-') k=-1;

	for(;c>='0' && c<='9';c=getchar()) sum=sum*10+c-48;

	return sum*k;

}

int h,w,a,b;

const int p=1e9+7;

ll fac[300000],inv[300000];

ll ans;

inline ll qsm(ll x,ll k)

{

	ll anss=1,base=x;

	while(k)

	{

		if(k&1) anss=(anss*base)%p;

		base=(base*base)%p;

		k>>=1;

	}

	return anss;

}		

inline ll C(int m,int n){

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

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

}

int main(){

	fac[0]=1;

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

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

	inv[200001]=qsm(fac[200001],p-2);

	for(re int i=200000;i>=1;--i) inv[i]=(inv[i+1]*(i+1))%p;

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

		//cout<<b-1<<" "<<i+b-2<<" "<<w-b-1<<" "<<w+h-b-i-1<<endl;

		//cout<<C(1,2)<<endl;

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

	}

	cout<<ans;

	return 0;

}

/*

6 3

2 3

1 2 

1 4 

4 5 

4 6 

0 2 5 1 2 3 

1 5 

1 3 

2 6 

*/

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

using namespace std;

typedef long long LL;

LL jc[300002];

LL quickmi(LL b,LL p,LL k)

{

	if(!p)return 1;

	LL ans=1,tmp=b;

	while(p)

	{

		if(p&1)ans=ans*tmp%k;

		tmp=tmp*tmp%k;

		p>>=1;

	}

	return ans%k;

}

LL C(LL n,LL m,LL k)

{

	if(n<m)return 0;

	return jc[n]*quickmi(jc[m]%k,k-2,k)%k*quickmi(jc[n-m]%k,k-2,k)%k;

}

LL Lucas(LL n,LL m,LL k)

{

	if(!m)return 1;

	return C(n%k,m%k,k)*Lucas(n/k,m/k,k)%k;

}

LL h,w,a,b,p;

LL ans;

int main()

{

	jc[0]=1;p=1e9+7;

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

	if(h<w)

	{

		swap(h,w);

		swap(a,b);

	}

	for(LL i=1;i<=h+w;i++)jc[i]=jc[i-1]*i%p;

	if(Lucas(b-1,b-1,p)==0)

	{

		ans=(Lucas(w-b-1+h-1,w-b-1,p)+ans)%p;

	}

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

	{

		ans=(ans+Lucas(b-1+i,b-1,p)*Lucas(w-b-1+h-1-i,w-b-1,p))%p;

	}

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

	return 0;

}