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<bits/stdc++.h>
using namespace std;

#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=1;i<=(n);i++)
#define mp make_pair
#define pb push_back
#define fst first
#define snd second
typedef long long ll;
typedef pair<int,int> pii;

const int maxn=600005;
const int mod=1e9+7;
int n,m,L,R;
int fac[maxn],ifac[maxn];

int C(int a,int b){
	if(a<b||a<0||b<0)return 0;
	return 1LL*fac[a]*ifac[b]%mod*ifac[a-b]%mod;
}

int calc(int R){
	int ans=0;
	rep(i,R+1){
		int cR=R-m*i;
		if(cR<0)break;
		rep(j,n-m+1){
			int ccR=cR-j*i;
			if(ccR<0)break;
			int cur=1LL*C(n-m,j)*(C(ccR+n,n)-C(ccR+n-m,n)+mod)%mod*(j&1?(mod-1):1)%mod;
			ans+=cur;
			if(ans>=mod)ans-=mod;
		}
	}
	return ans;
}

int main(){
	scanf("%d%d%d%d",&n,&m,&L,&R);
	fac[0]=ifac[0]=fac[1]=ifac[1]=1;
	for(int i=2;i<=n+R;i++){
		fac[i]=1LL*fac[i-1]*i%mod;
		ifac[i]=1LL*ifac[mod%i]*(mod-mod/i)%mod; 
	}
	REP(i,n+R)ifac[i]=1LL*ifac[i-1]*ifac[i]%mod;
	printf("%d\n",((C(R+n,n)-C(L-1+n,n)+mod)%mod-1LL*(calc(R)-calc(L-1)+mod)*C(n,m)%mod+mod)%mod);
	return 0;
}