N, M, D1, D2 = map(int, input().split()) mod = 10**9 + 7 D = D2 - D1 x = (M - 1) - D1*(N - 1) fac = [1 for _ in range(N+x+1)] for i in range(N+x): fac[i+1] = (i+1)*fac[i]%mod print(sum([(-1)**j * fac[x+N-j*(D+1)] * pow(N*fac[x-j*(D+1)]*fac[j]*fac[N-j-1], mod - 2, mod)\ for j in range(min(N, 1+x//(D+1)))])%mod)