Find the number of sequences of N non-negative integers A_1, A_2, ..., A_N that satisfy the following conditions:

* L \leq A_1 + A_2 + ... + A_N \leq R
* When the N elements are sorted in non-increasing order, the M-th and (M+1)-th elements are equal.



Since the answer can be enormous, print it modulo 10^9+7.

Constraints

* All values in input are integers.
* 1 \leq M < N \leq 3 \times 10^5
* 1 \leq L \leq R \leq 3 \times 10^5

Input

Input is given from Standard Input in the following format:


N M L R


Output

Print the number of sequences of N non-negative integers, modulo 10^9+7.

Examples

Input

4 2 3 7


Output

105


Input

2 1 4 8


Output

3


Input

141592 6535 89793 238462


Output

933832916
#include<bits/stdc++.h>
using namespace std;
const int mod=1000000007;

int quickpow(int x,int y)
{
	long long res=1,base=x;
	while(y)
	{
		if(y&1) res*=base,res%=mod;
		y>>=1; base*=base,base%=mod;
	}
	return res;
}
int inv(int x){return quickpow(x,mod-2);}

int prod[1000001];
int iprod[1000001];
int c(int n,int m){return 1ll*prod[n]*iprod[n-m]%mod*iprod[m]%mod;}

int solve2(int n,int m,int s,int l,int r)
{
	if(s-1ll*m*r<0) return 0;
	s-=m*r;
	int ans=0;
	for(int i=0;i<=n-m&&s-i*l>=0;i++)
	{
		ans=ans+1ll*((i%2==0)?1:-1)*c(s-i*l+n,n)*c(n-m,i)%mod;
		ans%=mod;
	}
	return 1ll*(ans+mod)*c(n,m)%mod;
}

int solve(int n,int m,int s)
{
	int ans=c(s+n,n);
	for(int i=0;i<=s;i++)
		ans=(ans-solve2(n,m,s,i,i)+solve2(n,m,s,i,i+1))%mod;
	return 1ll*(ans+mod)%mod;
}
signed main()
{
	int n,m,l,r;
	scanf("%d%d%d%d",&n,&m,&l,&r);
	
	prod[0]=1,iprod[0]=1;
	for(int i=1;i<=1000000;i++)
	{
		prod[i]=1ll*prod[i-1]*i%mod;
		iprod[i]=inv(prod[i]);
	}
	printf("%d",(solve(n,m,r)-solve(n,m,l-1)+mod)%mod);
	return 0;
}
