#include using namespace std; typedef long long ll; ll const mod = 1e9+7; #define p_ary(ary,a,b,i) do { cout << "["; for (int (i) = (a);(i) < (b);++(i)) cout << ary[(i)] << ((b)-1 == (i) ? "" : ", "); cout << "]\n"; } while(0) #define p_map(map,it) do {cout << "{";for (auto (it) = map.begin();;++(it)) {if ((it) == map.end()) {cout << "}\n";break;}else cout << "" << (it)->first << "=>" << (it)->second << ", ";}}while(0) const int MAX_N = 1300010; ll fact[MAX_N],fact_inv[MAX_N],inv[MAX_N]; ll pow(ll a,ll b) { ll ret; if (b == 0) ret = 1; else if (b == 1) ret = a; else { ll c = pow(a,b/2); if (b%2) ret = (c*c)%mod*a%mod; else ret = c*c%mod; } return ret; } void create_table(int n) { fact[0] = 1;fact[1] = 1; for (int i = 2;i <= n;++i) fact[i] = fact[i-1]*i%mod; fact_inv[n] = pow(fact[n],mod-2); for (int i = n;i > 0;--i) fact_inv[i-1] = fact_inv[i]*i%mod; for (int i = 1;i <= n;++i) inv[i] = fact_inv[i]*fact[i-1]%mod; } ll combi(ll a, ll b) { return fact[a]*fact_inv[b]%mod*fact_inv[a-b]%mod; } int main() { ll n,m,c,d; cin >> n >> m >> c >> d; if (c*(n-1)+1 > m) { cout << 0 << endl; exit(0); } create_table(n+m); ll ans = 0; m -= c*(n-1)+1; d -= c-1; for (int i = 0;i <= min(n-1,m/d);++i) { ll s = combi(m+n-d*i,n)*combi(n-1,i)%mod; if (i%2) ans -= s; else ans += s; ans %= mod; } cout << (ans+mod)%mod << endl; }