#include using namespace std; typedef long long ll; ll inf = 1e9+7; ll func[2000010] = {0}; ll inv[2000010] = {0}; ll mult(ll n, ll m){ if(m==1) return n%inf; else if(m%2==0){ ll t = mult(n,m/2); return (t*t)%inf; }else{ ll t = mult(n,m-1); return (t*n)%inf; } } void factorial(ll N){ for(ll i=0;i<=N;i++){ if(i==0){ func[i] = 1; inv[i] = 1; } else{ func[i] = (i*func[i-1])%inf; inv[i] = mult(func[i],inf-2); } } } ll comb(ll n,ll k){ if(n<=0 || k<0) return 0; if(k==0 || n==k) return 1; else return (((func[n]*inv[k])%inf)*inv[n-k])%inf; } ll hcomb(ll n,ll k){ if(n==0 && k==0) return 1; return comb(n+k-1,k); } int N,M,D1,D2; int main(){ cin >> N >> M >> D1 >> D2; factorial(max(N,M)); ll ans = 0; int x = M-1-D1*(N-1); for(int i=0;i<=N-1;i++){ ll r = comb(N-1,i)*comb(x-i*(D2-D1+1)+N,N); if(i%2==0) (ans += r)%=inf; else (ans += -r+inf)%=inf; } cout << ans << endl; }