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

using namespace std;



#define mp make_pair

#define pb push_back



typedef long long ll;

typedef pair<int, int> ii;

typedef pair<ll, ll> l4;





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

ll f[maxn], inv[maxn];

ll power(ll base, ll p)

{

  ll ret = 1;

  while (p)

    {

      if (p&1)

	ret = ret * base % mod;

      base = base * base % mod;

      p >>= 1;

    }

  return ret;

}

ll h, w, a, b;

ll cb(ll n, ll k)

{

  return f[n] * inv[k] % mod * inv[n-k] % mod;

}

inline void add(ll &a, ll b)

{

  a = a + b;

  if (a > mod)

    a %= mod;

}

int main()

{

  f[0] = 1;

  for (ll i = 1; i < maxn; ++i)

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

  inv[maxn-1] = power(f[maxn-1], mod-2);

  for (ll i = maxn-1; i >= 1; --i)

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

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

  ll ret = 0;

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

    add(ret, cb(h-a+i-2, h-a-1)*cb(a+w+1-i-2, a-1)%mod);

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

}


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

#include <algorithm>

#include <cstring>

#include <cstdio>

#include <vector>

#include <cstdlib>

#include <iomanip>

#include <cmath>

#include <ctime>

#include <map>

#include <set>

#include <queue>

using namespace std;

#define lowbit(x) (x&(-x))

#define max(x,y) (x>y?x:y)

#define min(x,y) (x<y?x:y)

#define MAX 100000000000000000

#define MOD 1000000007

#define pi acos(-1.0)

#define ei exp(1)

#define PI 3.141592653589793238462

#define INF 0x3f3f3f3f3f

#define mem(a) (memset(a,0,sizeof(a)))

typedef long long ll;

ll gcd(ll a,ll b){

    return b?gcd(b,a%b):a;

}

bool cmp(int x,int y)

{

    return x>y;

}

const int N=2e5+20;

const ll mod=1e9+7;

ll f[N],n,m,A,B;

ll powmod(ll x,ll n)

{

    ll s=1;

    while(n){

        if(n&1)

            s=(s*x)%mod;

        x=(x*x)%mod;

        n>>=1;

    }

    return s;

}

ll C(ll n,ll m)

{

    ll a=f[n];

    ll b=(f[m]*f[n-m])%mod;

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

}

int main()

{

    f[0]=1;

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

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

    while(cin>>n>>m>>A>>B){

        ll res=0;

        for(ll i=B+1;i<=m;i++){

            ll tmp=(C(i-1+n-A-1,n-A-1)*C(m-i+A-1,m-i))%mod;

            res=(res+tmp)%mod;

        }

        cout<<res<<endl;

    }

    return 0;

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

using namespace std;



#define mp make_pair

#define pb push_back



typedef long long ll;

typedef pair<int, int> ii;

typedef pair<ll, ll> l4;





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

ll f[maxn], inv[maxn];

ll power(ll base, ll p)

{

  ll ret = 1;

  while (p)

    {

      if (p&1)

	ret = ret * base % mod;

      base = base * base % mod;

      p >>= 1;

    }

  return ret;

}

ll h, w, a, b;

ll cb(ll n, ll k)

{

  return f[n] * inv[k] % mod * inv[n-k] % mod;

}

inline void add(ll &a, ll b)

{

  a = a + b;

  if (a > mod)

    a %= mod;

}

int main()

{

  f[0] = 1;

  for (ll i = 1; i < maxn; ++i)

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

  inv[maxn-1] = power(f[maxn-1], mod-2);

  for (ll i = maxn-1; i >= 1; --i)

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

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

  ll ret = 0;

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

    add(ret, cb(h-a+i-2, h-a-1)*cb(a+w+1-i-2, a-1)%mod);

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

}


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

#include<cstdio>

#include<cmath>

#include<cstring>

#include<queue>

#include<stack>

#include<map>

#include<string>

#include<algorithm>

using namespace std;

#define inf 0x3f3f3f3f

#define ll long long



const ll mod = 1e9+7;

const int maxn = 200005;

ll f[maxn],inv[maxn];

int N;



ll Pow(ll a,ll b)

{

	ll ans=1;

	while(b){

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

		a=(a*a)%mod;

		b>>=1;

	}

	return ans;

}



void init()

{

	f[0]=1;

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

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

	}

	inv[0]=1;

	inv[N]=Pow(f[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 f[a]*inv[b]%mod*inv[a-b]%mod;

}



int main()

{

    ll n,m,a,b;

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

	N=n+m-2;

	init();

	ll ans=C(n+m-2,n-1);

	for(ll i=1;i<=b;i++){

		ans-=C(n-a+i-2,n-a-1)*C(a-1+m-i,a-1);

		ans=(ans%mod+mod)%mod;

	}

	cout<<ans<<endl;

    return 0;

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

#include <algorithm>

#include <cstring>

#include <cstdio>

#include <vector>

#include <cstdlib>

#include <iomanip>

#include <cmath>

#include <ctime>

#include <map>

#include <set>

#include <queue>

using namespace std;

#define lowbit(x) (x&(-x))

#define max(x,y) (x>y?x:y)

#define min(x,y) (x<y?x:y)

#define MAX 100000000000000000

#define MOD 1000000007

#define pi acos(-1.0)

#define ei exp(1)

#define PI 3.141592653589793238462

#define INF 0x3f3f3f3f3f

#define mem(a) (memset(a,0,sizeof(a)))

typedef long long ll;

ll gcd(ll a,ll b){

    return b?gcd(b,a%b):a;

}

bool cmp(int x,int y)

{

    return x>y;

}

const int N=2e5+20;

const ll mod=1e9+7;

ll f[N],n,m,A,B;

ll powmod(ll x,ll n)

{

    ll s=1;

    while(n){

        if(n&1)

            s=(s*x)%mod;

        x=(x*x)%mod;

        n>>=1;

    }

    return s;

}

ll C(ll n,ll m)

{

    ll a=f[n];

    ll b=(f[m]*f[n-m])%mod;

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

}

int main()

{

    f[0]=1;

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

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

    while(cin>>n>>m>>A>>B){

        ll res=0;

        for(ll i=B+1;i<=m;i++){

            ll tmp=(C(i-1+n-A-1,n-A-1)*C(m-i+A-1,m-i))%mod;

            res=(res+tmp)%mod;

        }

        cout<<res<<endl;

    }

    return 0;

}

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

#include<cstdio>

#include<cmath>

#include<cstring>

#include<queue>

#include<stack>

#include<map>

#include<string>

#include<algorithm>

using namespace std;

#define inf 0x3f3f3f3f

#define ll long long



const ll mod = 1e9+7;

const int maxn = 200005;

ll f[maxn],inv[maxn];

int N;



ll Pow(ll a,ll b)

{

	ll ans=1;

	while(b){

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

		a=(a*a)%mod;

		b>>=1;

	}

	return ans;

}



void init()

{

	f[0]=1;

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

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

	}

	inv[0]=1;

	inv[N]=Pow(f[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 f[a]*inv[b]%mod*inv[a-b]%mod;

}



int main()

{

    ll n,m,a,b;

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

	N=n+m-2;

	init();

	ll ans=C(n+m-2,n-1);

	for(ll i=1;i<=b;i++){

		ans-=C(n-a+i-2,n-a-1)*C(a-1+m-i,a-1);

		ans=(ans%mod+mod)%mod;

	}

	cout<<ans<<endl;

    return 0;

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

#include<cstring>

#include<cstdio>

#define maxn 200009

#define mo 1000000007

using namespace std;

typedef long long ll;

ll ans,f[maxn],last;

int n,m,a,b;

ll pow(ll x,int t)

{

  ll now=x,sum=1;

  while (t)

  {

  	if (t&1) sum=(sum*now)%mo;

  	now=(now*now)%mo;

  	t=t>>1;

  }

  return sum;

}

ll calc(int x,int y)

{

  ll di=pow((f[x-y]*f[y])%mo,mo-2);

  return ((di*f[x])%mo);

}

int main()

{

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

  a=n-a+1;

  f[0]=1;

  for (int i=1;i<=n+m;i++) f[i]=(f[i-1]*i)%mo;

  int  x=a-1,rx=n-x;

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

  {

  	int ry=m-i+1;

  	ans=(ans+(calc(x+i-2,x-1)*calc(rx+ry-2,ry-1))%mo)%mo;

  }

  //cout<<calc(n+m-2,n-1)<<endl;

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

  return 0;

}

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

#include <cstdio>

#include <cstring>

#include <algorithm>

#include <set>

using std::min; using std::max;

using std::swap; using std::sort;

using std::set;

typedef long long ll;

typedef std::pair<int, int> pii;



template<typename T>

void read(T &x) {

	int flag = 1; x = 0; char ch = getchar();

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

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

	x *= flag;

}



const int _ = 2e5 + 10, P = 1e9 + 7;

int h, w, a, b, fac[_], ifac[_], now[_];



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;

}



int C(int n, int m) {

	if(m > n) return 0;

	return (int)(1ll * fac[n] * ifac[m] % P * ifac[n - m] % P);

}



int main () {

	read(h), read(w), fac[0] = 1;

	int mx = h + w;

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

	ifac[mx] = qpow(fac[mx], P - 2);

	for(int i = mx; i >= 1; --i) ifac[i - 1] = 1ll * ifac[i] * i % P;

	read(a), read(b);

	for(int y = b + 1; y <= w; ++y) {

		int x = h - a;

		now[y] = C(x - 1 + y - 1, x - 1);

	}

	ll ret = 0;

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

		(ret += 1ll * now[y] * C(w - y + a - 1, a - 1) % P) %= P;

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

	return 0;

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



using namespace std;



typedef long long ll;

typedef pair<ll,ll> ii;

typedef vector<ll> vi;

typedef vector<ii> vii;

typedef long double ld;

typedef pair<int,ii> iii;

typedef vector<iii> viii;



#define fi first

#define se second

#define pb push_back

#define mp make_pair



const int MOD = 1e9 + 7;

const ll INF = ll(1e18);

const ld eps = ld(1e-8);



ll modpow(ll a, ll b)

{

	if(b < 0) b += (MOD - 1);

	a %= MOD;

	ll r = 1;

	while(b)

	{

		if(b % 2)

		{

			r = (r*a)%MOD;

		}

		a = (a*a)%MOD;

		b /= 2;

	}

	if(r < 0) r += MOD;

	return r;

}



ll inv(ll x)

{

	return modpow(x, MOD - 2);

}



ll choose(ll n, ll r)

{

	if(r == 0)

	{

		return 1;

	}

	if(n == r)

	{

		return 1;

	}

	ll denom = 1;

	for (ll i = 2; i <= r; i++)

	{

		denom = (denom * i) % MOD;

	}

	ll res = 1;

	for (ll i = n; i > n - r; i--) 

	{

		res = (res * i) % MOD;

	}

	res = (res * modpow(denom, MOD - 2)) % MOD;

	if(res < 0) res += MOD;

	return res;

}



int main()

{

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

	int h, w, a, b;

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

	ll ans = 0;

	swap(a, b);

	ans += choose(w-a+h-2,w-a-1);

	ll cur1, cur2;

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

	{

		if(i == 1)

		{

			cur1 = a;

			cur2 = choose(w-a+h-3,w-a-1);

		}

		//cout << cur1 << ' ' << cur2 << endl;

		ans += (cur1*cur2)%MOD;

		ans %= MOD;

		if(ans < 0) ans += MOD;

		if(i < h - b - 1)

		{

			cur1 = (cur1*(a+i))%MOD;

			cur1 = (cur1*inv(i+1))%MOD;

			cur2 = (cur2*inv(w-a+h-2-i))%MOD;

			cur2 = (cur2*(h-i-1))%MOD;

		}

	}

	ans %= MOD;

	if(ans < 0) ans += MOD;

	cout << ans << '\n';

}


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

#include <cstdio>

#include <cstring>

#include <algorithm>

#include <set>

using std::min; using std::max;

using std::swap; using std::sort;

using std::set;

typedef long long ll;

typedef std::pair<int, int> pii;



template<typename T>

void read(T &x) {

	int flag = 1; x = 0; char ch = getchar();

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

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

	x *= flag;

}



const int _ = 2e5 + 10, P = 1e9 + 7;

int h, w, a, b, fac[_], ifac[_], now[_];



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;

}



int C(int n, int m) {

	if(m > n) return 0;

	return (int)(1ll * fac[n] * ifac[m] % P * ifac[n - m] % P);

}



int main () {

	read(h), read(w), fac[0] = 1;

	int mx = h + w;

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

	ifac[mx] = qpow(fac[mx], P - 2);

	for(int i = mx; i >= 1; --i) ifac[i - 1] = 1ll * ifac[i] * i % P;

	read(a), read(b);

	for(int y = b + 1; y <= w; ++y) {

		int x = h - a;

		now[y] = C(x - 1 + y - 1, x - 1);

	}

	ll ret = 0;

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

		(ret += 1ll * now[y] * C(w - y + a - 1, a - 1) % P) %= P;

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

	return 0;

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

using namespace std;



#define mp make_pair

#define pb push_back



typedef long long ll;

typedef pair<int, int> ii;

typedef pair<ll, ll> l4;





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

ll f[maxn], inv[maxn];

ll power(ll base, ll p)

{

  ll ret = 1;

  while (p)

    {

      if (p&1)

	ret = ret * base % mod;

      base = base * base % mod;

      p >>= 1;

    }

  return ret;

}

ll h, w, a, b;

ll cb(ll n, ll k)

{

  return f[n] * inv[k] % mod * inv[n-k] % mod;

}

inline void add(ll &a, ll b)

{

  a = a + b;

  if (a > mod)

    a %= mod;

}

int main()

{

  f[0] = 1;

  for (ll i = 1; i < maxn; ++i)

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

  inv[maxn-1] = power(f[maxn-1], mod-2);

  for (ll i = maxn-1; i >= 1; --i)

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

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

  ll ret = 0;

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

    add(ret, cb(h-a+i-2, h-a-1)*cb(a+w+1-i-2, a-1)%mod);

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

}


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

#include <cstdio>

#include <cstring>

#include <algorithm>

#include <set>

using std::min; using std::max;

using std::swap; using std::sort;

using std::set;

typedef long long ll;

typedef std::pair<int, int> pii;



template<typename T>

void read(T &x) {

	int flag = 1; x = 0; char ch = getchar();

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

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

	x *= flag;

}



const int _ = 2e5 + 10, P = 1e9 + 7;

int h, w, a, b, fac[_], ifac[_], now[_];



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;

}



int C(int n, int m) {

	if(m > n) return 0;

	return (int)(1ll * fac[n] * ifac[m] % P * ifac[n - m] % P);

}



int main () {

	read(h), read(w), fac[0] = 1;

	int mx = h + w;

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

	ifac[mx] = qpow(fac[mx], P - 2);

	for(int i = mx; i >= 1; --i) ifac[i - 1] = 1ll * ifac[i] * i % P;

	read(a), read(b);

	for(int y = b + 1; y <= w; ++y) {

		int x = h - a;

		now[y] = C(x - 1 + y - 1, x - 1);

	}

	ll ret = 0;

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

		(ret += 1ll * now[y] * C(w - y + a - 1, a - 1) % P) %= P;

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

	return 0;

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

#include <algorithm>

#include <cstring>

#include <cstdio>

#include <vector>

#include <cstdlib>

#include <iomanip>

#include <cmath>

#include <ctime>

#include <map>

#include <set>

#include <queue>

using namespace std;

#define lowbit(x) (x&(-x))

#define max(x,y) (x>y?x:y)

#define min(x,y) (x<y?x:y)

#define MAX 100000000000000000

#define MOD 1000000007

#define pi acos(-1.0)

#define ei exp(1)

#define PI 3.141592653589793238462

#define INF 0x3f3f3f3f3f

#define mem(a) (memset(a,0,sizeof(a)))

typedef long long ll;

ll gcd(ll a,ll b){

    return b?gcd(b,a%b):a;

}

bool cmp(int x,int y)

{

    return x>y;

}

const int N=2e5+20;

const ll mod=1e9+7;

ll f[N],n,m,A,B;

ll powmod(ll x,ll n)

{

    ll s=1;

    while(n){

        if(n&1)

            s=(s*x)%mod;

        x=(x*x)%mod;

        n>>=1;

    }

    return s;

}

ll C(ll n,ll m)

{

    ll a=f[n];

    ll b=(f[m]*f[n-m])%mod;

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

}

int main()

{

    f[0]=1;

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

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

    while(cin>>n>>m>>A>>B){

        ll res=0;

        for(ll i=B+1;i<=m;i++){

            ll tmp=(C(i-1+n-A-1,n-A-1)*C(m-i+A-1,m-i))%mod;

            res=(res+tmp)%mod;

        }

        cout<<res<<endl;

    }

    return 0;

}

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

#include <cstdio>

#include <cstring>

#include <algorithm>

#include <set>

using std::min; using std::max;

using std::swap; using std::sort;

using std::set;

typedef long long ll;

typedef std::pair<int, int> pii;



template<typename T>

void read(T &x) {

	int flag = 1; x = 0; char ch = getchar();

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

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

	x *= flag;

}



const int _ = 2e5 + 10, P = 1e9 + 7;

int h, w, a, b, fac[_], ifac[_], now[_];



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;

}



int C(int n, int m) {

	if(m > n) return 0;

	return (int)(1ll * fac[n] * ifac[m] % P * ifac[n - m] % P);

}



int main () {

	read(h), read(w), fac[0] = 1;

	int mx = h + w;

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

	ifac[mx] = qpow(fac[mx], P - 2);

	for(int i = mx; i >= 1; --i) ifac[i - 1] = 1ll * ifac[i] * i % P;

	read(a), read(b);

	for(int y = b + 1; y <= w; ++y) {

		int x = h - a;

		now[y] = C(x - 1 + y - 1, x - 1);

	}

	ll ret = 0;

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

		(ret += 1ll * now[y] * C(w - y + a - 1, a - 1) % P) %= P;

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

	return 0;

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

#include<cstdio>

#include<cmath>

#include<cstring>

#include<queue>

#include<stack>

#include<map>

#include<string>

#include<algorithm>

using namespace std;

#define inf 0x3f3f3f3f

#define ll long long



const ll mod = 1e9+7;

const int maxn = 200005;

ll f[maxn],inv[maxn];

int N;



ll Pow(ll a,ll b)

{

	ll ans=1;

	while(b){

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

		a=(a*a)%mod;

		b>>=1;

	}

	return ans;

}



void init()

{

	f[0]=1;

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

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

	}

	inv[0]=1;

	inv[N]=Pow(f[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 f[a]*inv[b]%mod*inv[a-b]%mod;

}



int main()

{

    ll n,m,a,b;

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

	N=n+m-2;

	init();

	ll ans=C(n+m-2,n-1);

	for(ll i=1;i<=b;i++){

		ans-=C(n-a+i-2,n-a-1)*C(a-1+m-i,a-1);

		ans=(ans%mod+mod)%mod;

	}

	cout<<ans<<endl;

    return 0;

}

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

#include <cstdio>

#include <cstring>

#include <algorithm>

#include <set>

using std::min; using std::max;

using std::swap; using std::sort;

using std::set;

typedef long long ll;

typedef std::pair<int, int> pii;



template<typename T>

void read(T &x) {

	int flag = 1; x = 0; char ch = getchar();

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

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

	x *= flag;

}



const int _ = 2e5 + 10, P = 1e9 + 7;

int h, w, a, b, fac[_], ifac[_], now[_];



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;

}



int C(int n, int m) {

	if(m > n) return 0;

	return (int)(1ll * fac[n] * ifac[m] % P * ifac[n - m] % P);

}



int main () {

	read(h), read(w), fac[0] = 1;

	int mx = h + w;

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

	ifac[mx] = qpow(fac[mx], P - 2);

	for(int i = mx; i >= 1; --i) ifac[i - 1] = 1ll * ifac[i] * i % P;

	read(a), read(b);

	for(int y = b + 1; y <= w; ++y) {

		int x = h - a;

		now[y] = C(x - 1 + y - 1, x - 1);

	}

	ll ret = 0;

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

		(ret += 1ll * now[y] * C(w - y + a - 1, a - 1) % P) %= P;

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

	return 0;

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

using namespace std;



#define mp make_pair

#define pb push_back



typedef long long ll;

typedef pair<int, int> ii;

typedef pair<ll, ll> l4;





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

ll f[maxn], inv[maxn];

ll power(ll base, ll p)

{

  ll ret = 1;

  while (p)

    {

      if (p&1)

	ret = ret * base % mod;

      base = base * base % mod;

      p >>= 1;

    }

  return ret;

}

ll h, w, a, b;

ll cb(ll n, ll k)

{

  return f[n] * inv[k] % mod * inv[n-k] % mod;

}

inline void add(ll &a, ll b)

{

  a = a + b;

  if (a > mod)

    a %= mod;

}

int main()

{

  f[0] = 1;

  for (ll i = 1; i < maxn; ++i)

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

  inv[maxn-1] = power(f[maxn-1], mod-2);

  for (ll i = maxn-1; i >= 1; --i)

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

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

  ll ret = 0;

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

    add(ret, cb(h-a+i-2, h-a-1)*cb(a+w+1-i-2, a-1)%mod);

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

}


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

using namespace std;

long long mod=1000000000+7,n,m,h,w,jie[200003],ans;

long long mi(long long x,long long t)

{

	if(t==1)

		return x;

	long long sum=mi(x,t/2);

	sum=(sum*sum)%mod;

	if(t%2==1)

		sum=(sum*x)%mod;

	return sum;

}

long long c(long long n,long long m)

{

	return (mi((jie[n-m]*jie[m])%mod,mod-2)*jie[n])%mod;

}

int main()

{

	cin>>n>>m>>h>>w;

	jie[0]=1,jie[1]=1;

	for(long long i=2; i<=200000; i++)

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

	for(long long i=1; h+i<=n&&w+i<=m; i++)

		ans=(ans+(c(n+w-h-1,w+i-1)*c(h+m-w-1,m-w-i)%mod))%mod;

	cout<<ans;

	return 0;

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

using namespace std;



#define mp make_pair

#define pb push_back



typedef long long ll;

typedef pair<int, int> ii;

typedef pair<ll, ll> l4;





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

ll f[maxn], inv[maxn];

ll power(ll base, ll p)

{

  ll ret = 1;

  while (p)

    {

      if (p&1)

	ret = ret * base % mod;

      base = base * base % mod;

      p >>= 1;

    }

  return ret;

}

ll h, w, a, b;

ll cb(ll n, ll k)

{

  return f[n] * inv[k] % mod * inv[n-k] % mod;

}

inline void add(ll &a, ll b)

{

  a = a + b;

  if (a > mod)

    a %= mod;

}

int main()

{

  f[0] = 1;

  for (ll i = 1; i < maxn; ++i)

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

  inv[maxn-1] = power(f[maxn-1], mod-2);

  for (ll i = maxn-1; i >= 1; --i)

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

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

  ll ret = 0;

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

    add(ret, cb(h-a+i-2, h-a-1)*cb(a+w+1-i-2, a-1)%mod);

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

}


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

}