#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdint>
#include <cstdio>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <tuple>
#include <utility>
#include <vector>
using namespace std;

using i64 = long long;

i64 MOD = 1000000007;

i64 N, M;

int main() {
    cin >> N >> M;
    if (N == 1) {
        cout << (M+1)%MOD << endl;
        return 0;
    }

    i64 k = (M / (N-1)) % MOD;

    i64 a = (2*k+1) % MOD * ((M+1) % MOD) % MOD;
    i64 b = (N-1) % MOD * k % MOD * (k+1) % MOD;
    cout << (a - b + MOD) % MOD << endl;
    // d = 0 -> M - 0 + 1
    // d = 1 -> M - (N-1) + 1
    // d = 2 -> M - 2*(N-1) + 1
    // ...
    // d = k -> M - k*(N-1) + 1
    // where k <= M/(N-1)
    return 0;
}
### Prompt

Create a solution in Cpp for 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 <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdint>
#include <cstdio>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <tuple>
#include <utility>
#include <vector>
using namespace std;

using i64 = long long;

i64 MOD = 1000000007;

i64 N, M;

int main() {
    cin >> N >> M;
    if (N == 1) {
        cout << (M+1)%MOD << endl;
        return 0;
    }

    i64 k = (M / (N-1)) % MOD;

    i64 a = (2*k+1) % MOD * ((M+1) % MOD) % MOD;
    i64 b = (N-1) % MOD * k % MOD * (k+1) % MOD;
    cout << (a - b + MOD) % MOD << endl;
    // d = 0 -> M - 0 + 1
    // d = 1 -> M - (N-1) + 1
    // d = 2 -> M - 2*(N-1) + 1
    // ...
    // d = k -> M - k*(N-1) + 1
    // where k <= M/(N-1)
    return 0;
}
```