#include <bits/stdc++.h>
#define MOD 1000000007LL
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

ll extgcd(ll a,ll b,ll& x,ll& y){
	ll d=a;
	if(b!=0LL){
		d=extgcd(b,a%b,y,x);
		y-=(a/b)*x;
	}else{
		x=1;
		y=0;
	}
	return d;
}

ll mod_inverse(ll a,ll m){
	ll x,y;
	extgcd(a,m,x,y);
	return (m+x%m)%m;
}

ll n,m;

int main(void){
	scanf("%lld%lld",&n,&m);
	if(n==1LL){
		printf("%lld\n",(m+1LL)%MOD);
		return 0;
	}
	ll d_max=m/(n-1LL);
	ll val2=(((m+1LL)%MOD)*(d_max%MOD))%MOD;
	val2=val2*2LL%MOD;
	ll val3=d_max%MOD;
	ll val4=(n-1LL)%MOD;
	ll val5=(n-1LL)%MOD*(d_max%MOD)%MOD;
	ll val6=(val4+val5)%MOD;
	ll res=(val2-val3*val6%MOD+MOD)%MOD;
	res+=(m+1LL)%MOD;
	res%=MOD;
	printf("%lld\n",res);
	return 0;
}
### Prompt

Construct a cpp code solution to the problem outlined:

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>
#define MOD 1000000007LL
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

ll extgcd(ll a,ll b,ll& x,ll& y){
	ll d=a;
	if(b!=0LL){
		d=extgcd(b,a%b,y,x);
		y-=(a/b)*x;
	}else{
		x=1;
		y=0;
	}
	return d;
}

ll mod_inverse(ll a,ll m){
	ll x,y;
	extgcd(a,m,x,y);
	return (m+x%m)%m;
}

ll n,m;

int main(void){
	scanf("%lld%lld",&n,&m);
	if(n==1LL){
		printf("%lld\n",(m+1LL)%MOD);
		return 0;
	}
	ll d_max=m/(n-1LL);
	ll val2=(((m+1LL)%MOD)*(d_max%MOD))%MOD;
	val2=val2*2LL%MOD;
	ll val3=d_max%MOD;
	ll val4=(n-1LL)%MOD;
	ll val5=(n-1LL)%MOD*(d_max%MOD)%MOD;
	ll val6=(val4+val5)%MOD;
	ll res=(val2-val3*val6%MOD+MOD)%MOD;
	res+=(m+1LL)%MOD;
	res%=MOD;
	printf("%lld\n",res);
	return 0;
}
```