#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
#define INF 1<<30
#define LINF 1LL<<60
const ll Mod = 1e9 + 7;
int main() {
	cin.tie(0); ios::sync_with_stdio(false);
	ll n, m; cin >> n >> m;
	if (n == 1) {
		cout << ((m + 1)%Mod) << endl;
		return 0;
	}
	ll d = m / (n - 1);
	ll a, b;
	a = ((m + 1)%Mod)*(d%Mod); a %= Mod;
	if (d % 2 == 0) {
		b = ((d / 2)%Mod)*((d + 1)%Mod); b %= Mod;
		b *= (n - 1)%Mod; b %= Mod;
	}
	else {
		b = (((d + 1) / 2)%Mod)*(d%Mod); b %= Mod;
		b *= (n - 1)%Mod; b %= Mod;
	}
	ll ans = (a - b + Mod)%Mod;
	ans = (ans * 2) % Mod;
	ans = (ans + (m + 1)%Mod) % Mod;
	cout << ans << endl;
	return 0;
}
### Prompt

Your task is to create a CPP solution to 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;
typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
#define INF 1<<30
#define LINF 1LL<<60
const ll Mod = 1e9 + 7;
int main() {
	cin.tie(0); ios::sync_with_stdio(false);
	ll n, m; cin >> n >> m;
	if (n == 1) {
		cout << ((m + 1)%Mod) << endl;
		return 0;
	}
	ll d = m / (n - 1);
	ll a, b;
	a = ((m + 1)%Mod)*(d%Mod); a %= Mod;
	if (d % 2 == 0) {
		b = ((d / 2)%Mod)*((d + 1)%Mod); b %= Mod;
		b *= (n - 1)%Mod; b %= Mod;
	}
	else {
		b = (((d + 1) / 2)%Mod)*(d%Mod); b %= Mod;
		b *= (n - 1)%Mod; b %= Mod;
	}
	ll ans = (a - b + Mod)%Mod;
	ans = (ans * 2) % Mod;
	ans = (ans + (m + 1)%Mod) % Mod;
	cout << ans << endl;
	return 0;
}
```