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>
// iostream is too mainstream
#include <cstdio>
// bitch please
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <cmath>
#include <iomanip>
#include <time.h>
#define dibs reserve
#define OVER9000 1234567890
#define ALL_THE(CAKE,LIE) for(auto LIE =CAKE.begin(); LIE != CAKE.end(); LIE++)
#define tisic 47
#define soclose 1e-8
#define chocolate win
// so much chocolate
#define patkan 9
#define ff first
#define ss second
#define abs(x) (((x) < 0)?-(x):(x))
#define uint unsigned int
#define dbl long double
#define pi 3.14159265358979323846
using namespace std;
// mylittledoge

using cat = long long;

#ifdef DONLINE_JUDGE
	// palindromic tree is better than splay tree!
	#define lld I64d
#endif

constexpr cat mod = 1000000007;

constexpr int MX = 700000;
cat fac[MX], inv[MX];

cat pw(cat a, cat e) {
	if(e <= 0) return 1;
	cat x = pw(a, e/2);
	return e&1 ? (x * x % mod * a) % mod : (x * x % mod);
}

cat C(int N, int K) {
	if(K < 0 || N < 0 || K > N) return 0;
	return fac[N] * inv[K] % mod * inv[N-K] % mod;
}

cat solve(int N, int M, int R) {
	cat cnt_total = C(R+N, N);
	cat cnt = 0;
	for(int K = 0; K <= N-M; K++) {
		cat sum = 0;
		for(int X = 1; X <= R/(M+K)+1; X++)
			sum += C(R-M*X-K*X+N, N) - C(R-M*X-K*(X-1)+N, N);
		cnt = (cnt + sum % mod * (K&1 ? -1 : 1) * C(N-M, K)) % mod;
	}
	return (cnt_total - cnt * C(N, M)) % mod;
}

int main() {
	cin.sync_with_stdio(0);
	cin.tie(0);
	cout << fixed << setprecision(10);
	fac[0] = inv[0] = 1;
	for(int i = 1; i < MX; i++) fac[i] = i * fac[i-1] % mod;
	for(int i = 1; i < MX; i++) inv[i] = pw(i, mod-2) * inv[i-1] % mod;
	int N, M, L, R;
	cin >> N >> M >> L >> R;
	cat ans = solve(N, M, R) - solve(N, M, L-1);
	ans %= mod;
	if(ans < 0) ans += mod;
	cout << ans << "\n";
	return 0;
}

// look at my code
// my code is amazing
