#include "bits/stdc++.h"

using namespace std;

//int N,M,K,L,R,H,W;
long long int N,M,K,L,R,H,W;

constexpr long long int MOD=1000000007;
//constexpr  int MOD=1000000007;
//constexpr int MOD=998244353;
//constexpr long long int MOD=998244353;

long long int power(long long int x, long long int n, long long int M) {
	long long int ret = 1;
	long long int by = x;
	while (n) {
		if (n & 1) {
			ret *= by;
			ret %= M;
		}
		by *= by;
		by %= M;
		n >>= 1;
	}
	return ret;
}

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	cin>>N>>M;
	if(N==1){
		cout<<(M+1)%MOD<<endl;
		return 0;
	}
	if(N>M+1){
		cout<<(M+1)%MOD<<endl;
		return 0;
	}
	long long int a=M-(N-1)+1;
	long long int v=-(N-1);
	long long int num=a/abs(v)+1;
	long long int ans=(a%MOD)*(num%MOD);
	a%=MOD;
	v+=MOD*MOD;
	v%=MOD;
	ans%=MOD;
	num%=MOD;
	//cout<<a<<" "<<v<<" "<<num<<endl;
	//cout<<ans<<endl;
	long long int add=v;
	add*=((num)*(num+MOD-1))%MOD;
	add%=MOD;
	add*=power(2,MOD-2,MOD);
	ans+=add;
	ans%=MOD;
	ans*=2;
	ans%=MOD;
	//cout<<ans<<endl;
	ans+=M+1;
	ans%=MOD;
	cout<<ans<<endl;
	
	
	return 0;
}

### Prompt

In CPP, your task is to solve the following problem:

B: Ebi-chan and Integer Sequences-

problem

Ebi-chan likes sequences. I especially like arithmetic progressions. This time, I decided to create a sequence that meets the following conditions.

* Arithmetic progression of length n
* When the i-th element of the sequence is defined as s_i, all s_i (1 \ leq i \ leq n) are integers that satisfy 0 \ leq s_i \ leq m.



How many sequences are there that satisfy the above conditions? However, the answer can be very large, so print the remainder after dividing by 10 ^ 9 + 7.

Input format

Input is given in one line.


n m

n represents the length of the sequence.

Constraint

* 1 \ leq n \ leq 10 ^ {15}
* 0 \ leq m \ leq 10 ^ {15}



Output format

Divide the number of arithmetic progressions that satisfy the condition by 10 ^ 9 + 7 and output the remainder in one row.

Input example 1


3 9

Output example 1


50

Input example 2


10000000000 10000000000

Output example 2


999999942

Note that the input does not fit in a 32-bit integer.





Example

Input

3 9


Output

50

### Response

```cpp
#include "bits/stdc++.h"

using namespace std;

//int N,M,K,L,R,H,W;
long long int N,M,K,L,R,H,W;

constexpr long long int MOD=1000000007;
//constexpr  int MOD=1000000007;
//constexpr int MOD=998244353;
//constexpr long long int MOD=998244353;

long long int power(long long int x, long long int n, long long int M) {
	long long int ret = 1;
	long long int by = x;
	while (n) {
		if (n & 1) {
			ret *= by;
			ret %= M;
		}
		by *= by;
		by %= M;
		n >>= 1;
	}
	return ret;
}

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	cin>>N>>M;
	if(N==1){
		cout<<(M+1)%MOD<<endl;
		return 0;
	}
	if(N>M+1){
		cout<<(M+1)%MOD<<endl;
		return 0;
	}
	long long int a=M-(N-1)+1;
	long long int v=-(N-1);
	long long int num=a/abs(v)+1;
	long long int ans=(a%MOD)*(num%MOD);
	a%=MOD;
	v+=MOD*MOD;
	v%=MOD;
	ans%=MOD;
	num%=MOD;
	//cout<<a<<" "<<v<<" "<<num<<endl;
	//cout<<ans<<endl;
	long long int add=v;
	add*=((num)*(num+MOD-1))%MOD;
	add%=MOD;
	add*=power(2,MOD-2,MOD);
	ans+=add;
	ans%=MOD;
	ans*=2;
	ans%=MOD;
	//cout<<ans<<endl;
	ans+=M+1;
	ans%=MOD;
	cout<<ans<<endl;
	
	
	return 0;
}

```