stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <iostream>

using namespace std;



long long p = 1000000007;

long long mod_fact[200000];



void mod_fact_init(){

    mod_fact[0]=mod_fact[1]=1;

    for(int i=2;i<200000;i++){

        mod_fact[i]=(mod_fact[i-1]*i)%p;

    }

}





long long mod_pow(long long a,long long b){

    a%=p;

    if(b==0){

        return 1;

    }else if(b%2==0){

        return mod_pow(a*a,b/2)%p;

    }else{

        return (a*mod_pow(a,b-1))%p;

    }

}



long long mod_comb(long long a,long long b){

    long long c = (mod_fact[a]*mod_pow(mod_fact[a-b],p-2))%p;

    return (c*mod_pow(mod_fact[b],p-2))%p;

}



int main(void){

    long long h,w,a,b,c=0;

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

    

    mod_fact_init();

    

    a=h-a-1;

    for(int i=0;a-i>=0&&b+i<=w-1;i++){

        c = (c+(mod_comb(a+b,a-i)%p)*(mod_comb(h-a+w-b-2,h-a-1+i)%p))%p;

    }

    cout<<c<<endl;

}


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

#include <vector>

using namespace std;

long long const mod = 1000000007;

long long mod_fact(int x){

    static vector<long long> fact = {1, 1};

    if(x < 0)return 0; //

    if(x < fact.size())return fact[x];

    for(int i = fact.size(); i <= x; i++){

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

    }

    return fact[x];

}



long long mod_pow(long long a, long long b){

    long long res = 1;

    a %= mod;

    while(b > 0){

        if(b%2 == 0){

            a = (a * a) % mod;

            b /= 2;

        }else{

            res = (res * a) % mod;

            b--;

        }

    }

    return res;

}



long long mod_comb(long long a, long long b){

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

    long long c = (mod_fact(a) * mod_pow(mod_fact(a-b), mod-2)) % mod;

    return (c * mod_pow(mod_fact(b), mod-2)) % mod;

}



int main(void){

    long long h, w, a, b, ans = 0;

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

    for(int i=0;;i++){

        int y = h-a-i;

        int x = b+1+i;

        //cout << y << " " << x << endl;

        if(y < 1 || x > w)break;

        ans += (mod_comb(y+x-2, x-1) * mod_comb(h-y+w-x, h-y))%mod;

        ans %= mod;

        //cout << ans << endl;

    }

    cout << ans << endl;

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

using namespace std;

typedef long long ll;

ll f[200001], M=1e9+7;

ll p(ll a, ll b){

    if(b==0)return 1;

    if(b%2==0)return p((a*a)%M, b/2);

    return (a*p(a, b-1))%M;

}

ll c(int a, int b){

    return ((f[a]*p(f[b], M-2))%M * p(f[a-b], M-2))%M;

}

int main() {

    ll h, w, a, b, ans=0;

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

    f[0] = 1;

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

        f[i] = (f[i-1] * i) % M;

    }

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

        int x=b+1+h-a-i;

        

        if(x>w)break;

        ans += (c(i+x-2, i-1) * c(h-i+w-x, h-i))%M;

        ans %= M;

    }

    cout << ans << endl;

	return 0;

}

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

#include <vector>

using namespace std;

long long const mod = 1000000007;

long long mod_fact(int x){

    static vector<long long> fact = {1, 1};

    if(x < 0)return 0; //

    if(x < fact.size())return fact[x];

    for(int i = fact.size(); i <= x; i++){

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

    }

    return fact[x];

}



long long mod_pow(long long a, long long b){

    long long res = 1;

    a %= mod;

    while(b > 0){

        if(b%2 == 0){

            a = (a * a) % mod;

            b /= 2;

        }else{

            res = (res * a) % mod;

            b--;

        }

    }

    return res;

}



long long mod_comb(long long a, long long b){

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

    long long c = (mod_fact(a) * mod_pow(mod_fact(a-b), mod-2)) % mod;

    return (c * mod_pow(mod_fact(b), mod-2)) % mod;

}



int main(void){

    long long h, w, a, b, ans = 0;

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

    for(int i=0;;i++){

        int y = h-a-i;

        int x = b+1+i;

        //cout << y << " " << x << endl;

        if(y < 1 || x > w)break;

        ans += (mod_comb(y+x-2, x-1) * mod_comb(h-y+w-x, h-y))%mod;

        ans %= mod;

        //cout << ans << endl;

    }

    cout << ans << 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: 1.4100539545194866x):
#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;

}
// 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: 4.074081931769125x):
#include <bits/stdc++.h>



using namespace std;



const long long mod = 1000000007; 



long long Pow(long long a, long long b) {

    long long cnt, ret; 

    cnt = a; 

    ret = 1; 

    while (b) {

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

        cnt = cnt * cnt % mod; 

        b >>= 1;  

    }

    return ret; 

}



long long inv(long long a) {

    return Pow(a, mod - 2); 

}



int main() {

    ios::sync_with_stdio(false);

    cin.tie(0);

    cout << fixed << setprecision(15); 

    int n, m, a, b; 

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

    vector<long long> st, ed; 

    st.resize(m - b);

    ed.resize(m - b); 

    st[0] = 1;

    for (int i = n - a + b - 1; i >= n - a; --i) st[0] = st[0] * i % mod; 

    for (int i = 1; i <= b; ++i) st[0] = st[0] * inv(i) % mod; 

    for (int i = 1; i < m - b; ++i) {

        st[i] = st[i - 1] * (n - a + b + i - 1) % mod; 

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

    }

//    for (int i = 0; i < m - b; ++i)

//        cout << st[i] << endl; 

    ed[m - b - 1] = 1;

    for (int i = m - b - 2; i >= 0; --i) {

        ed[i] = ed[i + 1] * (a + m - b - 2 - i) % mod; 

        ed[i] = ed[i] * inv(m - b - 1 - i) % mod; 

    } 

//    for (int i = 0; i < m - b; ++i)

//        cout << ed[i] << endl; 

    long long sum = 0; 

    for (int i = 0; i < m - b; ++i) {

        sum = (sum + st[i] * ed[i] % mod) % mod; 

    }

    cout << sum << endl; 

    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: 3.0688936941649203x):
#include <bits/stdc++.h>



using namespace std;



const long long mod = 1000000007; 



long long Pow(long long a, long long b) {

    long long cnt, ret; 

    cnt = a; 

    ret = 1; 

    while (b) {

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

        cnt = cnt * cnt % mod; 

        b >>= 1;  

    }

    return ret; 

}



long long inv(long long a) {

    return Pow(a, mod - 2); 

}



int main() {

    ios::sync_with_stdio(false);

    cin.tie(0);

    cout << fixed << setprecision(15); 

    int n, m, a, b; 

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

    vector<long long> st, ed; 

    st.resize(m - b);

    ed.resize(m - b); 

    st[0] = 1;

    for (int i = n - a + b - 1; i >= n - a; --i) st[0] = st[0] * i % mod; 

    for (int i = 1; i <= b; ++i) st[0] = st[0] * inv(i) % mod; 

    for (int i = 1; i < m - b; ++i) {

        st[i] = st[i - 1] * (n - a + b + i - 1) % mod; 

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

    }

//    for (int i = 0; i < m - b; ++i)

//        cout << st[i] << endl; 

    ed[m - b - 1] = 1;

    for (int i = m - b - 2; i >= 0; --i) {

        ed[i] = ed[i + 1] * (a + m - b - 2 - i) % mod; 

        ed[i] = ed[i] * inv(m - b - 1 - i) % mod; 

    } 

//    for (int i = 0; i < m - b; ++i)

//        cout << ed[i] << endl; 

    long long sum = 0; 

    for (int i = 0; i < m - b; ++i) {

        sum = (sum + st[i] * ed[i] % mod) % mod; 

    }

    cout << sum << endl; 

    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: 4.185119373982255x):
#include<iostream>

#include<iomanip>

#include<cstdio>

#include<cstdlib>

#include<cmath>

#include<cstring>

#include<ctime>

#include<vector>

#include<queue>

#include<map>

#include<deque>

#include<stack>

#include<algorithm>

#define N 200005

using namespace std;

const int INF=0x7fffffff;

const double Pi=acos(-1);

const long long Mod=1e9+7;

long long F[N],Inv[N];

long long Quick_Pow(long long X,long long K)

{

	long long Ans=1;

	while(K)

	{

		if(K&1)Ans=Ans*X%Mod;

		K>>=1;

		X=X*X%Mod;

	}

	return Ans;

}

long long Get_Inv(long long X)

{

	return Quick_Pow(X,Mod-2);

}

long long C(long long n,long long m)//ÇóC(n,m) 

{

	return F[n]*(Inv[m]*Inv[n-m]%Mod)%Mod;

}

int main()

{

	int i;

	long long n,m,A,B,Maxx;

	scanf("%lld%lld%lld%lld",&n,&m,&A,&B);

	Maxx=n+m;

	F[0]=1;Inv[0]=1;

	for(i=1;i<=Maxx;i++)

	{

		F[i]=F[i-1]*i%Mod;

		Inv[i]=Get_Inv(F[i]);

	}//ÌáÇ°´æ´¢ºÃiµÄ½×³ËºÍ¶ÔÓ¦µÄÄæÔª 

	long long Ans=0;

	for(i=1;i<=n-A;i++)//(1,1)->(i,B)->(i,B+1)->(n,m) 

	{

		Ans=(Ans+C(i+B-2,B-1)*C(n-i+m-B-1,m-B-1)%Mod)%Mod;

	}

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

	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: 3.152535140736444x):
#include<iostream>

#include<iomanip>

#include<cstdio>

#include<cstdlib>

#include<cmath>

#include<cstring>

#include<ctime>

#include<vector>

#include<queue>

#include<map>

#include<deque>

#include<stack>

#include<algorithm>

#define N 200005

using namespace std;

const int INF=0x7fffffff;

const double Pi=acos(-1);

const long long Mod=1e9+7;

long long F[N],Inv[N];

long long Quick_Pow(long long X,long long K)

{

	long long Ans=1;

	while(K)

	{

		if(K&1)Ans=Ans*X%Mod;

		K>>=1;

		X=X*X%Mod;

	}

	return Ans;

}

long long Get_Inv(long long X)

{

	return Quick_Pow(X,Mod-2);

}

long long C(long long n,long long m)//ÇóC(n,m) 

{

	return F[n]*(Inv[m]*Inv[n-m]%Mod)%Mod;

}

int main()

{

	int i;

	long long n,m,A,B,Maxx;

	scanf("%lld%lld%lld%lld",&n,&m,&A,&B);

	Maxx=n+m;

	F[0]=1;Inv[0]=1;

	for(i=1;i<=Maxx;i++)

	{

		F[i]=F[i-1]*i%Mod;

		Inv[i]=Get_Inv(F[i]);

	}//ÌáÇ°´æ´¢ºÃiµÄ½×³ËºÍ¶ÔÓ¦µÄÄæÔª 

	long long Ans=0;

	for(i=1;i<=n-A;i++)//(1,1)->(i,B)->(i,B+1)->(n,m) 

	{

		Ans=(Ans+C(i+B-2,B-1)*C(n-i+m-B-1,m-B-1)%Mod)%Mod;

	}

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

	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: 4.162568139373736x):
#include<iostream>

#include<cstring>

const int mod=1000000007;

using namespace std;

long long npow(long long x)

{

	long long ans=1,n=mod-2;

	while(n)

	{

		if(n&1) ans=ans*x%mod;

		x=x*x%mod;

		n>>=1;

	}

	return ans;

}

long long co(long long x,long long y)

{

	long long ans=1;

	for(int i=0;i<x;i++)

		ans=(ans*(y-i))%mod;

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

		ans=(ans*npow(x-i))%mod;

	return ans;

}

int main()

{

	long long h,w,a,b,c1=1,c2,ans=0;

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

	c1=1;

	c2=co(h-1,h+w-b-2);

	ans=(ans+c1*c2%mod)%mod;

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

	{

		c1=(c1*(i+b-2)%mod*npow(i-1))%mod;

		c2=(c2*(h-i+1)%mod*npow(h-i+w-b))%mod;

		ans=(ans+c1*c2%mod)%mod;

	}

	cout<<ans<<endl;

	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: 3.135547916904235x):
#include<iostream>

#include<cstring>

const int mod=1000000007;

using namespace std;

long long npow(long long x)

{

	long long ans=1,n=mod-2;

	while(n)

	{

		if(n&1) ans=ans*x%mod;

		x=x*x%mod;

		n>>=1;

	}

	return ans;

}

long long co(long long x,long long y)

{

	long long ans=1;

	for(int i=0;i<x;i++)

		ans=(ans*(y-i))%mod;

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

		ans=(ans*npow(x-i))%mod;

	return ans;

}

int main()

{

	long long h,w,a,b,c1=1,c2,ans=0;

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

	c1=1;

	c2=co(h-1,h+w-b-2);

	ans=(ans+c1*c2%mod)%mod;

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

	{

		c1=(c1*(i+b-2)%mod*npow(i-1))%mod;

		c2=(c2*(h-i+1)%mod*npow(h-i+w-b))%mod;

		ans=(ans+c1*c2%mod)%mod;

	}

	cout<<ans<<endl;

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

}