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 ll = long long;
using namespace std;

const int MAX = 600600;
const ll MOD = 1000000007;
ll fac[MAX], finv[MAX], inv[MAX];

void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i-1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD/i) % MOD;
        finv[i] = finv[i-1] * inv[i] % MOD;
    }
}

ll COM(int n, int k){
    if (n < 0 || k < 0 || n < k) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

ll solve(ll a, ll n, ll m) {
    ll ans = 0;
    for (ll i = 1; i <= a; i++) {
        for (ll j = 0; j <= n - m; j++) {
            ll num = a - m * i - j * i;
            if (num < 0) break;
            ll add = ( COM(n + num, n) - COM(n + num - m, n) + MOD) % MOD;
            add = add * COM(n - m, j) % MOD;
            if (j % 2 == 0) ans = ( ans + add ) % MOD;
            else ans = ( ans - add + MOD ) % MOD;
        }
    }
    ans = ans * COM(n, m) % MOD;
    return ( COM(n + a, n) - ans + MOD ) % MOD;
}

int main() {
    ll n, m, l , r; cin >> n >> m >> l >> r;
    COMinit();
    cout << ( solve(r, n, m) - solve(l - 1, n, m) + MOD ) % MOD << endl;
    return 0;
}