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 <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#define popcount __builtin_popcount
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
const ll MOD=1e9+7;
ll powmod(ll a, ll k){
    ll ap=a, ans=1;
    while(k){
        if(k&1){
            ans*=ap;
            ans%=MOD;
        }
        ap=ap*ap;
        ap%=MOD;
        k>>=1;
    }
    return ans;
}
ll inv(ll a){
	return powmod(a, MOD-2);
}
ll f[2000001], invf[2000001];
void fac(int n){
    f[0]=1;
    for(ll i=1; i<=n; i++) f[i]=f[i-1]*i%MOD;
    invf[n]=inv(f[n]);
    for(ll i=n-1; i>=0; i--) invf[i]=invf[i+1]*(i+1)%MOD;
}
ll comb(int x, int y){
    if(!(0<=y && y<=x)) return 0;
    return f[x]*invf[y]%MOD*invf[x-y]%MOD;
}
int n, m;
ll solve(int r){
  if(r==0) return 1;
  ll ret=comb(r+n, n);
  for(int i=0; i<=r; i++){
    for(int j=0; r-(ll)(m+j)*(i+1)>=0; j++){
      ll c=comb(n, m)*comb(n-m, j)%MOD*comb(r-(m+j)*(i+1)+n, n)%MOD;
      if(j&1) (ret+=c)%=MOD;
      else (ret+=MOD-c)%=MOD;
    }
  }
  for(int i=1; i<=r; i++){
    for(int j=0; r-(ll)m*(i+1)-(ll)j*i>=0; j++){
      ll c=comb(n, m)*comb(n-m, j)%MOD*comb(r-m*(i+1)-j*i+n, n)%MOD;
      if((j&1)==0) (ret+=c)%=MOD;
      else (ret+=MOD-c)%=MOD;
    }
  }
  return ret;
}
int main()
{
	int l, r; cin>>n>>m>>l>>r;
  fac(r+n);
  cout<<(solve(r)-solve(l-1)+MOD)%MOD<<endl;
	return 0;
}