Problem: 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

Solution (in CPP):

Solution:
#include<cstdio>
#include<algorithm>
using namespace std;

typedef long long ll;
const int Maxn=1e6;
const ll Mod=1e9+7;

ll fac[Maxn+5],inv_fac[Maxn+5];
ll QuickPow(ll a,ll k) {
	ll ret=1;
	while(k) {
		if(k&1)ret=(ret*a)%Mod;
		a=(a*a)%Mod;
		k>>=1;
	}
	return ret;
}
void init() {
	fac[0]=1;
	for(int i=1;i<=Maxn;i++)
		fac[i]=fac[i-1]*i%Mod;
	inv_fac[0]=1,inv_fac[Maxn]=QuickPow(fac[Maxn],Mod-2);
	for(int i=Maxn-1;i>=1;i--)
		inv_fac[i]=inv_fac[i+1]*(i+1)%Mod;
}
ll C(int n,int m){return fac[n]*inv_fac[m]%Mod*inv_fac[n-m]%Mod;}

ll calc(int n,int m,int num,int l,int r) {
	if(num-1LL*r*m<0)return 0;
	else num-=(r*m);
	ll ret=0;
	for(int i=0,dir=1;i<=n-m&&num>=0;i++,num-=l,dir*=-1)
		ret=(ret+1LL*dir*C(num+n,n)%Mod*C(n-m,i)%Mod+Mod)%Mod;
	return ret*C(n,m)%Mod;
}
ll Solve(int n,int m,int num) {
	ll ret=C(n+num,n);
	for(int i=num;i>=1;i--) {
		int del=(calc(n,m,num,i,i)-calc(n,m,num,i,i+1)+Mod)%Mod;
		ret=(ret-del+Mod)%Mod;
	}
	return ret;
}

int main() {
	#ifdef LOACL
	freopen("in.txt","r",stdin);
	freopen("out.txt","w",stdout);
	#endif
	int N,M,L,R;
	init();
	scanf("%d %d %d %d",&N,&M,&L,&R);
	printf("%lld\n",(Solve(N,M,R)-Solve(N,M,L-1)+Mod)%Mod);
	return 0;
}