#include const int mod = 1000000007; int n, m, d1, d2; /* [x^m] 1/(1-x) x/(1-x) (x^d1 + ... + x^d2)^{n-1} [x^m] x/(1-x)^2 x^{d1 (n-1)} [(1 - x^{d2-d1+1}) / (1-x) ]^{n-1} [x^{m-d1(n-1)-1}] (1 - x^{d2-d1+1})^{n-1} / (1-x)^{n+1} [x^{k}] (1 - x^{e})^{n-1} / (1-x)^{n+1} \sum_i (-1)^i\binom{n-1}{i} \binom{k-ie+n}{n} = \sum_i (-1)^i (k-ie+n)! / (n i! (n-1-i)! (k-ie)!) */ int modpow(int x, int n){ int r=1; for(;n;n>>=1){ if(n&1) r = (long long) r * x % mod; x = (long long) x * x % mod; } return r; } int fact[1500000]; int ifact[1500000]; int main(){ int i, k, e, r; scanf("%d%d%d%d",&n,&m,&d1,&d2); fact[0] = 1; for(i=1;i=0;i--) ifact[i] = (long long) ifact[i+1] * (i+1) % mod; k = m - d1*(n-1) - 1; e = d2 - d1 + 1; if(k < 0){ puts("0"); return 0; } r = 0; for(i=0; i<=n-1 && i*e <= k; i++){ int z; z = (long long) fact[k-i*e+n] * ifact[i] % mod * ifact[n-1-i] % mod * ifact[k-i*e] % mod; if(i&1) r -= z; else r += z; r = r % mod; } r = (long long) r * modpow(n, mod-2) % mod; printf("%d\n", r); return 0; }