mod = 1000000007 def mod_build(n) : fact = [1]*(n+1) inv_fact = [1]*(n+1) for i in range(1,n+1): fact[i] = fact[i-1]*i %mod inv_fact[n] = pow(fact[n],mod-2,mod) for i in range(n,0,-1): inv_fact[i-1] = inv_fact[i]*i %mod return fact, inv_fact def comb(n,k,fact,inv_fact) : if n<0 or k<0 or k>n : return 0 return fact[n]*inv_fact[k]*inv_fact[n-k]%mod def solve(n,m,d1,d2) : m = m-(n-1)*(d1-1) if m<0 : return 0 d2=d2-d1+1 fact, inv_fact = mod_build(m+1) ans = 0 for i in range(0,n): ret=comb(m-d2*i,n,fact,inv_fact)*comb(n-1,i,fact,inv_fact)%mod if i%2 ==1 : ans+=mod-ret else : ans+=ret return ans%mod n, m, d1, d2 = map(int, input().split()) print(solve(n, m, d1, d2))