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 <iostream>
#define llint long long
#define mod 1000000007

using namespace std;

llint n, m, l, r;
const int FACT_MAX = 600005;
llint fact[FACT_MAX], fact_inv[FACT_MAX];

llint modpow(llint a, llint n)
{
	if(n == 0) return 1;
	if(n % 2){
		return ((a%mod) * (modpow(a, n-1)%mod)) % mod;
	}
	else{
		return modpow((a*a)%mod, n/2) % mod;
	}
}

void make_fact()
{
	llint val = 1;
	fact[0] = 1;
	for(int i = 1; i < FACT_MAX; i++){
		val *= i;
		val %= mod;
		fact[i] = val;
	}
	fact_inv[FACT_MAX-1] = modpow(fact[FACT_MAX-1], mod-2);
	for(int i = FACT_MAX-2; i >= 0; i--){
		fact_inv[i] = fact_inv[i+1] * (i+1) % mod;
	}
}

llint comb(llint n, llint k)
{
	llint ret = 1;
	ret *= fact[n];
	ret *= fact_inv[k], ret %= mod;
	ret *= fact_inv[n-k], ret %= mod;
	return ret;
};

llint calc(llint R, llint lb, llint ub)
{
	llint ret = 0, rem = R-lb*m;
	for(int i = 0; rem >= 0 && i <= n-m; i++){
		llint tmp = comb(rem+n, n) * comb(n-m, i) % mod;
		if(i % 2) ret += mod - tmp, ret %= mod;
		else ret += tmp, ret %= mod;
		rem -= ub+1;
	}
	return ret;
}

llint solve(llint R)
{
	llint ret = 0;
	for(int i = 1; i <= R/m; i++){
		ret += calc(R, i, i-1), ret %= mod;
		ret += mod - calc(R, i+1, i-1), ret %= mod;
	}
	ret *= comb(n, m), ret %= mod;
	ret = comb(R+n, n) - ret + mod, ret %= mod;
	return ret;
}

int main(void)
{
	cin >> n >> m >> l >> r;
	make_fact();
	llint ans = (solve(r) - solve(l-1) + mod) % mod;
	//ans *= comb(n, m), ans %= mod;
	cout << ans << endl;
	return 0;
}