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

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

}

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

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

#include <cstdio>

#define int long long

#define N 200002

using namespace std;

const int mod=1000000007;

int a,b,x,y,i,j,f[N],inv[N];

int poww(int a,int b)

{

	int ans=1,base=a;

	while(b){

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

		base=base*base%mod;

		b>>=1;

	}

	return ans;

}

int C(int n,int m)

{

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

}

signed main()

{

	cin>>a>>b>>x>>y;

	f[0]=1;

	for(i=1;i<=200000;i++) f[i]=f[i-1]*i%mod;

	inv[200000]=poww(f[200000],mod-2);

	for(i=199999;i>=0;i--) inv[i]=inv[i+1]*(i+1)%mod;

	int ans=C(a+b-2,b-1);

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

		for(j=1;j<=y;j++) ans=(ans-C(i+j-3,j-1)*C(a+b-i-j,b-j)%mod+mod)%mod;

	}

	cout<<(ans+mod)%mod<<endl;

	return 0;

}


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

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

#include <cstring>

using namespace std;

typedef long long ll;

ll n,m,a,b;

ll fpow(ll b,ll p,ll mod)

{

	ll ans=1,tmp=b;

	while(p)

	{

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

		tmp=tmp*tmp%mod;

		p>>=1;

	}

	return ans%mod;

}

ll inv(ll b,ll mod)

{

	return fpow(b,mod-2,mod)%mod;

}

const int N=200002;

const ll mod=1e9+7;

ll fac[N],ans=0;

ll C(ll n,ll m)

{

	if(n<m)return 0;

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

}

ll Lucas(ll n,ll m)

{

	if(!m)return 1;

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

}

int main()

{

	fac[0]=1;

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

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

	for(ll i=1;i<=n-a&&i<=m-b;i++)

	{

		ll X=n-a-i,Y=b+i-1;

		ans=(ans+Lucas(X+Y,X)%mod*Lucas(m-Y+n-X-2,m-Y-1)%mod)%mod;

	}

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

	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: 1.4485281643832197x):
#include <cstdio>

#include <cstring>

using namespace std;

typedef long long ll;

ll n,m,a,b;

ll fpow(ll b,ll p,ll mod)

{

	ll ans=1,tmp=b;

	while(p)

	{

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

		tmp=tmp*tmp%mod;

		p>>=1;

	}

	return ans%mod;

}

ll inv(ll b,ll mod)

{

	return fpow(b,mod-2,mod)%mod;

}

const int N=200002;

const ll mod=1e9+7;

ll fac[N],ans=0;

ll C(ll n,ll m)

{

	if(n<m)return 0;

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

}

ll Lucas(ll n,ll m)

{

	if(!m)return 1;

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

}

int main()

{

	fac[0]=1;

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

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

	for(ll i=1;i<=n-a&&i<=m-b;i++)

	{

		ll X=n-a-i,Y=b+i-1;

		ans=(ans+Lucas(X+Y,X)%mod*Lucas(m-Y+n-X-2,m-Y-1)%mod)%mod;

	}

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

	return 0;

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

#include <cstdio>

#define int long long

#define N 200002

using namespace std;

const int mod=1000000007;

int a,b,x,y,i,j,f[N],inv[N];

int poww(int a,int b)

{

	int ans=1,base=a;

	while(b){

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

		base=base*base%mod;

		b>>=1;

	}

	return ans;

}

int C(int n,int m)

{

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

}

signed main()

{

	cin>>a>>b>>x>>y;

	f[0]=1;

	for(i=1;i<=200000;i++) f[i]=f[i-1]*i%mod;

	inv[200000]=poww(f[200000],mod-2);

	for(i=199999;i>=0;i--) inv[i]=inv[i+1]*(i+1)%mod;

	int ans=C(a+b-2,b-1);

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

		for(j=1;j<=y;j++) ans=(ans-C(i+j-3,j-1)*C(a+b-i-j,b-j)%mod+mod)%mod;

	}

	cout<<(ans+mod)%mod<<endl;

	return 0;

}


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

#include <cstring>

using namespace std;

typedef long long ll;

ll n,m,a,b;

ll fpow(ll b,ll p,ll mod)

{

	ll ans=1,tmp=b;

	while(p)

	{

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

		tmp=tmp*tmp%mod;

		p>>=1;

	}

	return ans%mod;

}

ll inv(ll b,ll mod)

{

	return fpow(b,mod-2,mod)%mod;

}

const int N=200002;

const ll mod=1e9+7;

ll fac[N],ans=0;

ll C(ll n,ll m)

{

	if(n<m)return 0;

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

}

ll Lucas(ll n,ll m)

{

	if(!m)return 1;

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

}

int main()

{

	fac[0]=1;

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

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

	for(ll i=1;i<=n-a&&i<=m-b;i++)

	{

		ll X=n-a-i,Y=b+i-1;

		ans=(ans+Lucas(X+Y,X)%mod*Lucas(m-Y+n-X-2,m-Y-1)%mod)%mod;

	}

	printf("%lld\n",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: 4.2259909480664914x):
#include<iostream>

#include<cstdio>

#include<cmath>

#include<cstring>

using namespace std;



#define REP(i,e,s) for(register int i=e; i<=s; i++)

#define DREP(i,e,s) for(register int i=e; i>=s; i--)

#define ll long long

#define DE(...) fprintf(stderr,__VA_ARGS__)

#define DEBUG(a) DE("DEBUG: %d\n",a)



#define int long long



int read() {

	int x=0,f=1,ch=getchar();

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

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

	return x*f;

}

const int MOD=1e9+7,MAXN=200000+10;



int fac[MAXN],inv[MAXN];



int qpow(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 m,int n) {

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

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

}



int calc(int x_1,int y_1,int x_2,int y_2) {

	return c(abs(x_2-x_1)+abs(y_2-y_1),abs(x_2-x_1));

}



signed main() {

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

	fac[0]=1;

	REP(i,1,h+w) fac[i]=(fac[i-1]*i)%MOD;

	

	REP(i,1,h+w) inv[i]=qpow(fac[i],MOD-2);

	int ans=0;	

	REP(i,1,h-a) {

		ans=(ans+calc(1,1,b,i)*(calc(b+1,i,w,h)))%MOD;

	}

	

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

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

#include<cstdio>

#include<cmath>

#include<cstring>

using namespace std;



#define REP(i,e,s) for(register int i=e; i<=s; i++)

#define DREP(i,e,s) for(register int i=e; i>=s; i--)

#define ll long long

#define DE(...) fprintf(stderr,__VA_ARGS__)

#define DEBUG(a) DE("DEBUG: %d\n",a)



#define int long long



int read() {

	int x=0,f=1,ch=getchar();

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

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

	return x*f;

}

const int MOD=1e9+7,MAXN=200000+10;



int fac[MAXN],inv[MAXN];



int qpow(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 m,int n) {

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

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

}



int calc(int x_1,int y_1,int x_2,int y_2) {

	return c(abs(x_2-x_1)+abs(y_2-y_1),abs(x_2-x_1));

}



signed main() {

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

	fac[0]=1;

	REP(i,1,h+w) fac[i]=(fac[i-1]*i)%MOD;

	

	REP(i,1,h+w) inv[i]=qpow(fac[i],MOD-2);

	int ans=0;	

	REP(i,1,h-a) {

		ans=(ans+calc(1,1,b,i)*(calc(b+1,i,w,h)))%MOD;

	}

	

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

	return 0;

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

}

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

#include<cstdio>

#include<cmath>

#include<cstring>

using namespace std;



#define REP(i,e,s) for(register int i=e; i<=s; i++)

#define DREP(i,e,s) for(register int i=e; i>=s; i--)

#define ll long long

#define DE(...) fprintf(stderr,__VA_ARGS__)

#define DEBUG(a) DE("DEBUG: %d\n",a)



#define int long long



int read() {

	int x=0,f=1,ch=getchar();

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

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

	return x*f;

}

const int MOD=1e9+7,MAXN=200000+10;



int fac[MAXN],inv[MAXN];



int qpow(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 m,int n) {

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

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

}



int calc(int x_1,int y_1,int x_2,int y_2) {

	return c(abs(x_2-x_1)+abs(y_2-y_1),abs(x_2-x_1));

}



signed main() {

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

	fac[0]=1;

	REP(i,1,h+w) fac[i]=(fac[i-1]*i)%MOD;

	

	REP(i,1,h+w) inv[i]=qpow(fac[i],MOD-2);

	int ans=0;	

	REP(i,1,h-a) {

		ans=(ans+calc(1,1,b,i)*(calc(b+1,i,w,h)))%MOD;

	}

	

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

	return 0;

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

#include <cstdio>

#define int long long

#define N 200002

using namespace std;

const int mod=1000000007;

int a,b,x,y,i,j,f[N],inv[N];

int poww(int a,int b)

{

	int ans=1,base=a;

	while(b){

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

		base=base*base%mod;

		b>>=1;

	}

	return ans;

}

int C(int n,int m)

{

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

}

signed main()

{

	cin>>a>>b>>x>>y;

	f[0]=1;

	for(i=1;i<=200000;i++) f[i]=f[i-1]*i%mod;

	inv[200000]=poww(f[200000],mod-2);

	for(i=199999;i>=0;i--) inv[i]=inv[i+1]*(i+1)%mod;

	int ans=C(a+b-2,b-1);

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

		for(j=1;j<=y;j++) ans=(ans-C(i+j-3,j-1)*C(a+b-i-j,b-j)%mod+mod)%mod;

	}

	cout<<(ans+mod)%mod<<endl;

	return 0;

}


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

#include<cstdio>

#include<cmath>

#include<cstring>

using namespace std;



#define REP(i,e,s) for(register int i=e; i<=s; i++)

#define DREP(i,e,s) for(register int i=e; i>=s; i--)

#define ll long long

#define DE(...) fprintf(stderr,__VA_ARGS__)

#define DEBUG(a) DE("DEBUG: %d\n",a)



#define int long long



int read() {

	int x=0,f=1,ch=getchar();

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

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

	return x*f;

}

const int MOD=1e9+7,MAXN=200000+10;



int fac[MAXN],inv[MAXN];



int qpow(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 m,int n) {

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

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

}



int calc(int x_1,int y_1,int x_2,int y_2) {

	return c(abs(x_2-x_1)+abs(y_2-y_1),abs(x_2-x_1));

}



signed main() {

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

	fac[0]=1;

	REP(i,1,h+w) fac[i]=(fac[i-1]*i)%MOD;

	

	REP(i,1,h+w) inv[i]=qpow(fac[i],MOD-2);

	int ans=0;	

	REP(i,1,h-a) {

		ans=(ans+calc(1,1,b,i)*(calc(b+1,i,w,h)))%MOD;

	}

	

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

	return 0;

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

#include <cstring>

using namespace std;

typedef long long ll;

ll n,m,a,b;

ll fpow(ll b,ll p,ll mod)

{

	ll ans=1,tmp=b;

	while(p)

	{

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

		tmp=tmp*tmp%mod;

		p>>=1;

	}

	return ans%mod;

}

ll inv(ll b,ll mod)

{

	return fpow(b,mod-2,mod)%mod;

}

const int N=200002;

const ll mod=1e9+7;

ll fac[N],ans=0;

ll C(ll n,ll m)

{

	if(n<m)return 0;

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

}

ll Lucas(ll n,ll m)

{

	if(!m)return 1;

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

}

int main()

{

	fac[0]=1;

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

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

	for(ll i=1;i<=n-a&&i<=m-b;i++)

	{

		ll X=n-a-i,Y=b+i-1;

		ans=(ans+Lucas(X+Y,X)%mod*Lucas(m-Y+n-X-2,m-Y-1)%mod)%mod;

	}

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

	return 0;

}

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

#include<cstdio>

#include<cmath>

#include<cstring>

using namespace std;



#define REP(i,e,s) for(register int i=e; i<=s; i++)

#define DREP(i,e,s) for(register int i=e; i>=s; i--)

#define ll long long

#define DE(...) fprintf(stderr,__VA_ARGS__)

#define DEBUG(a) DE("DEBUG: %d\n",a)



#define int long long



int read() {

	int x=0,f=1,ch=getchar();

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

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

	return x*f;

}

const int MOD=1e9+7,MAXN=200000+10;



int fac[MAXN],inv[MAXN];



int qpow(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 m,int n) {

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

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

}



int calc(int x_1,int y_1,int x_2,int y_2) {

	return c(abs(x_2-x_1)+abs(y_2-y_1),abs(x_2-x_1));

}



signed main() {

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

	fac[0]=1;

	REP(i,1,h+w) fac[i]=(fac[i-1]*i)%MOD;

	

	REP(i,1,h+w) inv[i]=qpow(fac[i],MOD-2);

	int ans=0;	

	REP(i,1,h-a) {

		ans=(ans+calc(1,1,b,i)*(calc(b+1,i,w,h)))%MOD;

	}

	

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

	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.230837421255146x):
#include<cstdio>

#include<cstring>

#include<algorithm>

#define LL long long

using namespace std;

const int mod=1e9+7,M=1e6+7;

LL read(){

	LL ans=0,f=1,c=getchar();

	while(c<'0'||c>'9'){if(c=='-') f=-1; c=getchar();}

	while(c>='0'&&c<='9'){ans=ans*10+(c-'0'); c=getchar();}

	return ans*f;

}

LL n,m,A,B;

LL qmod(LL a,LL b){

	LL ans=1;

	while(b){

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

		b>>=1; a=a*a%mod;

	}

	return ans;

}

LL w[M],f[M];

void pre(){

	int mx=2e5; w[0]=1;

	for(int i=1;i<=mx;i++) w[i]=w[i-1]*i%mod;

	f[mx]=qmod(w[mx],mod-2);

	for(int i=mx;i>=1;i--) f[i-1]=f[i]*i%mod;

} 

LL C(LL n,LL m){return w[n]*f[n-m]%mod*f[m]%mod;}

LL F(int x,int y,int nx,int ny){

	int p=nx-x,q=ny-y;

	return C(p+q,q);

}

LL ans;

int main(){

	pre();

	n=read(); m=read(); A=read(); B=read();

	ans=F(1,1,n,m);

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

		int sum=F(1,1,n-A,i)*F(n-A+1,i,n,m)%mod;

		ans=(ans-sum)%mod;

		ans=(ans+mod)%mod;

	}

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

	return 0;

}