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

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

#include<ext/pb_ds/hash_policy.hpp>

#include<ext/pb_ds/assoc_container.hpp>

#define N 200005

using namespace __gnu_pbds;

const int mod = 1e9 + 7;

using namespace std;

typedef long long LL;

typedef unsigned long long uLL;

struct custom_hash {

    static uint64_t splitmix64(uint64_t x) {

        x += 0x9e3779b97f4a7c15;

        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;

        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;

        return x ^ (x >> 31);

    }

    size_t operator()(uint64_t x) const {

        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();

        return splitmix64(x + FIXED_RANDOM);

    }

};

LL z = 1;

int read(){

	int x, f = 1;

	char ch;

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

	x = ch - '0';

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

	return x * f;

}

int ksm(int a, int b, int p){

	int s = 1;

	while(b){

		if(b & 1) s = z * s * a % p;

		a = z * a * a % p;

		b >>= 1;

	}

	return s;

}



int maxn = N - 5, fac[N], inv[N];

int C(int n, int m){

	return z * fac[n] * inv[m] % mod * inv[n - m] % mod; 

}

int main(){

	int i, j, a, b, n, m, c, d, ans, sum = 0;

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

	inv[maxn] = ksm(fac[maxn], mod - 2, mod);

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

	scanf("%d%d%d%d", &n, &m, &c, &d);

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

	for(i = 1; i <= d; i++){

		a = n - c;

		b = i - 1;

		j = C(a + b, a);

		j = (j - sum) % mod;

		sum = (sum + j) % mod;

		j = z * j * C(c - 1 + m - i, c - 1) % mod;

		//printf("%d %d\n", i, j);

		ans = (ans - j) % mod;

	}

	ans = (ans + mod) % mod;

	printf("%d", 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: 1.1628874399857354x):
#include <bits/stdc++.h>

#include<ext/pb_ds/hash_policy.hpp>

#include<ext/pb_ds/assoc_container.hpp>

#define N 200005

using namespace __gnu_pbds;

const int mod = 1e9 + 7;

using namespace std;

typedef long long LL;

typedef unsigned long long uLL;

struct custom_hash {

    static uint64_t splitmix64(uint64_t x) {

        x += 0x9e3779b97f4a7c15;

        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;

        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;

        return x ^ (x >> 31);

    }

    size_t operator()(uint64_t x) const {

        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();

        return splitmix64(x + FIXED_RANDOM);

    }

};

LL z = 1;

int read(){

	int x, f = 1;

	char ch;

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

	x = ch - '0';

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

	return x * f;

}

int ksm(int a, int b, int p){

	int s = 1;

	while(b){

		if(b & 1) s = z * s * a % p;

		a = z * a * a % p;

		b >>= 1;

	}

	return s;

}



int maxn = N - 5, fac[N], inv[N];

int C(int n, int m){

	return z * fac[n] * inv[m] % mod * inv[n - m] % mod; 

}

int main(){

	int i, j, a, b, n, m, c, d, ans, sum = 0;

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

	inv[maxn] = ksm(fac[maxn], mod - 2, mod);

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

	scanf("%d%d%d%d", &n, &m, &c, &d);

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

	for(i = 1; i <= d; i++){

		a = n - c;

		b = i - 1;

		j = C(a + b, a);

		j = (j - sum) % mod;

		sum = (sum + j) % mod;

		j = z * j * C(c - 1 + m - i, c - 1) % mod;

		//printf("%d %d\n", i, j);

		ans = (ans - j) % mod;

	}

	ans = (ans + mod) % mod;

	printf("%d", 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: 1.2901581396490511x):
#include<bits/stdc++.h>

using namespace std;

typedef double db;

typedef long long ll;

typedef pair<int, int> pii;

#define fi first

#define se second

#define empb emplace_back

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

#define lbd(a, x) lower_bound(all(a), x)

const int mod = 1e9 + 7;

int power_mod(int a, int b) {

	int res = 1;

	for(; b; b >>= 1, a = (ll) a * a % mod)

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

	return res;

}

const int N = 2e5 + 10;

int fac[N], ifac[N];

int C(int n, int m) {

	if(n < m || m < 0) return 0;

	return (ll) fac[n] * ifac[m] % mod * ifac[n - m] % mod;

}

int main() {

#ifdef local

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

#endif

	ios::sync_with_stdio(false);

	cin.tie(0), cout.tie(0);

  fac[0] = ifac[0] = 1;

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

  ifac[N - 1] = power_mod(fac[N - 1], mod - 2);

  for(int i = N - 2; i; i--) ifac[i] = (ll) ifac[i + 1] * (i + 1) % mod;

  int n, m; cin >> n >> m;

  int a, b; cin >> a >> b;

  int res = C(n + m - 2, n - 1);

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

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

  }

  if(res < 0) res += mod;

  cout << res << '\n';

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

using namespace std;

typedef double db;

typedef long long ll;

typedef pair<int, int> pii;

#define fi first

#define se second

#define empb emplace_back

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

#define lbd(a, x) lower_bound(all(a), x)

const int mod = 1e9 + 7;

int power_mod(int a, int b) {

	int res = 1;

	for(; b; b >>= 1, a = (ll) a * a % mod)

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

	return res;

}

const int N = 2e5 + 10;

int fac[N], ifac[N];

int C(int n, int m) {

	if(n < m || m < 0) return 0;

	return (ll) fac[n] * ifac[m] % mod * ifac[n - m] % mod;

}

int main() {

#ifdef local

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

#endif

	ios::sync_with_stdio(false);

	cin.tie(0), cout.tie(0);

  fac[0] = ifac[0] = 1;

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

  ifac[N - 1] = power_mod(fac[N - 1], mod - 2);

  for(int i = N - 2; i; i--) ifac[i] = (ll) ifac[i + 1] * (i + 1) % mod;

  int n, m; cin >> n >> m;

  int a, b; cin >> a >> b;

  int res = C(n + m - 2, n - 1);

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

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

  }

  if(res < 0) res += mod;

  cout << res << '\n';

	return 0;

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

#include<ext/pb_ds/hash_policy.hpp>

#include<ext/pb_ds/assoc_container.hpp>

#define N 200005

using namespace __gnu_pbds;

const int mod = 1e9 + 7;

using namespace std;

typedef long long LL;

typedef unsigned long long uLL;

struct custom_hash {

    static uint64_t splitmix64(uint64_t x) {

        x += 0x9e3779b97f4a7c15;

        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;

        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;

        return x ^ (x >> 31);

    }

    size_t operator()(uint64_t x) const {

        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();

        return splitmix64(x + FIXED_RANDOM);

    }

};

LL z = 1;

int read(){

	int x, f = 1;

	char ch;

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

	x = ch - '0';

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

	return x * f;

}

int ksm(int a, int b, int p){

	int s = 1;

	while(b){

		if(b & 1) s = z * s * a % p;

		a = z * a * a % p;

		b >>= 1;

	}

	return s;

}



int maxn = N - 5, fac[N], inv[N];

int C(int n, int m){

	return z * fac[n] * inv[m] % mod * inv[n - m] % mod; 

}

int main(){

	int i, j, a, b, n, m, c, d, ans, sum = 0;

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

	inv[maxn] = ksm(fac[maxn], mod - 2, mod);

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

	scanf("%d%d%d%d", &n, &m, &c, &d);

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

	for(i = 1; i <= d; i++){

		a = n - c;

		b = i - 1;

		j = C(a + b, a);

		j = (j - sum) % mod;

		sum = (sum + j) % mod;

		j = z * j * C(c - 1 + m - i, c - 1) % mod;

		//printf("%d %d\n", i, j);

		ans = (ans - j) % mod;

	}

	ans = (ans + mod) % mod;

	printf("%d", ans);

	return 0;

}


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

using namespace std;

typedef double db;

typedef long long ll;

typedef pair<int, int> pii;

#define fi first

#define se second

#define empb emplace_back

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

#define lbd(a, x) lower_bound(all(a), x)

const int mod = 1e9 + 7;

int power_mod(int a, int b) {

	int res = 1;

	for(; b; b >>= 1, a = (ll) a * a % mod)

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

	return res;

}

const int N = 2e5 + 10;

int fac[N], ifac[N];

int C(int n, int m) {

	if(n < m || m < 0) return 0;

	return (ll) fac[n] * ifac[m] % mod * ifac[n - m] % mod;

}

int main() {

#ifdef local

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

#endif

	ios::sync_with_stdio(false);

	cin.tie(0), cout.tie(0);

  fac[0] = ifac[0] = 1;

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

  ifac[N - 1] = power_mod(fac[N - 1], mod - 2);

  for(int i = N - 2; i; i--) ifac[i] = (ll) ifac[i + 1] * (i + 1) % mod;

  int n, m; cin >> n >> m;

  int a, b; cin >> a >> b;

  int res = C(n + m - 2, n - 1);

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

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

  }

  if(res < 0) res += mod;

  cout << res << '\n';

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

#include<algorithm>

using namespace std;

#define MOD 1000000007

#define MAXN 200005

#define LL long long

LL inv[MAXN],s[MAXN];

int N;

int n,m,x,y;

LL Pow(LL a,int b)

{

    LL ans=1;

    while(b)

	{

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

        a=a*a%MOD;

        b>>=1;

    }

    return ans;

}

void Pre()

{

    s[0]=1;

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

        s[i]=s[i-1]*i%MOD;

    inv[0]=1;

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

}

int main()

{

 

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

    scanf("%d%d",&x,&y);

    N=n+m-2;

    Pre();

    LL ans=0;

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

    {

        ans+=C(n-x+i-2,i-1)*C(x+m-i-1,x-1)%MOD;

        ans%=MOD;

    }

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

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

#include<algorithm>

using namespace std;

#define MOD 1000000007

#define MAXN 200005

#define LL long long

LL inv[MAXN],s[MAXN];

int N;

int n,m,x,y;

LL Pow(LL a,int b)

{

    LL ans=1;

    while(b)

	{

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

        a=a*a%MOD;

        b>>=1;

    }

    return ans;

}

void Pre()

{

    s[0]=1;

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

        s[i]=s[i-1]*i%MOD;

    inv[0]=1;

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

}

int main()

{

 

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

    scanf("%d%d",&x,&y);

    N=n+m-2;

    Pre();

    LL ans=0;

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

    {

        ans+=C(n-x+i-2,i-1)*C(x+m-i-1,x-1)%MOD;

        ans%=MOD;

    }

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

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

#include<algorithm>

using namespace std;

#define MOD 1000000007

#define MAXN 200005

#define LL long long

LL inv[MAXN],s[MAXN];

int N;

int n,m,x,y;

LL Pow(LL a,int b)

{

    LL ans=1;

    while(b)

	{

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

        a=a*a%MOD;

        b>>=1;

    }

    return ans;

}

void Pre()

{

    s[0]=1;

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

        s[i]=s[i-1]*i%MOD;

    inv[0]=1;

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

}

int main()

{

 

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

    scanf("%d%d",&x,&y);

    N=n+m-2;

    Pre();

    LL ans=0;

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

    {

        ans+=C(n-x+i-2,i-1)*C(x+m-i-1,x-1)%MOD;

        ans%=MOD;

    }

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

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

#include<algorithm>

using namespace std;

#define MOD 1000000007

#define MAXN 200005

#define LL long long

LL inv[MAXN],s[MAXN];

int N;

int n,m,x,y;

LL Pow(LL a,int b)

{

    LL ans=1;

    while(b)

	{

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

        a=a*a%MOD;

        b>>=1;

    }

    return ans;

}

void Pre()

{

    s[0]=1;

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

        s[i]=s[i-1]*i%MOD;

    inv[0]=1;

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

}

int main()

{

 

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

    scanf("%d%d",&x,&y);

    N=n+m-2;

    Pre();

    LL ans=0;

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

    {

        ans+=C(n-x+i-2,i-1)*C(x+m-i-1,x-1)%MOD;

        ans%=MOD;

    }

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

}//