Dreamoon loves summing up something for no reason. One day he obtains two integers a and b occasionally. He wants to calculate the sum of all nice integers. Positive integer x is called nice if <image> and <image>, where k is some integer number in range [1, a].

By <image> we denote the quotient of integer division of x and y. By <image> we denote the remainder of integer division of x and y. You can read more about these operations here: http://goo.gl/AcsXhT.

The answer may be large, so please print its remainder modulo 1 000 000 007 (109 + 7). Can you compute it faster than Dreamoon?

Input

The single line of the input contains two integers a, b (1 ≤ a, b ≤ 107).

Output

Print a single integer representing the answer modulo 1 000 000 007 (109 + 7).

Examples

Input

1 1


Output

0


Input

2 2


Output

8

Note

For the first sample, there are no nice integers because <image> is always zero.

For the second sample, the set of nice integers is {3, 5}.
#include <bits/stdc++.h>
const long double eps = 1e-9;
const double pi = acos(-1.0);
const long long inf = 1e18;
const long long mod = 1000000007;
using namespace std;
int fun(int a, int b) {
  if (a < 1 || b < 1) return 0;
  int result = 0;
  for (int x = 1; x <= 100000; x++) {
    if (x % b == 0) continue;
    int i = x / b;
    int j = x % b;
    if (i % j != 0) continue;
    if (i / j >= 1 && i / j <= a) {
      result += x;
    }
  }
  return result;
}
int gun(int i, int j) { return fun(i, j) - fun(i - 1, j); }
long long hun(int a, int b) {
  long long result = 0;
  if (b % 2 == 0) {
    long long tmp = b;
    result = (((tmp / 2) * (tmp + 1)) % mod) * (tmp + 2);
    result %= mod;
  }
  if (b % 2 == 1) {
    long long tmp = b;
    result = (tmp * ((tmp + 1) / 2) % mod) * (tmp + 2);
    result %= mod;
  }
  if (a == 0) return result;
  long long delta = 0;
  if (b % 2 == 0) {
    long long tmp = b;
    delta = (((tmp / 2) * (tmp + 1)) % mod) * (tmp + 1);
    delta %= mod;
  }
  if (b % 2 == 1) {
    long long tmp = b;
    delta = (tmp * ((tmp + 1) / 2) % mod) * (tmp + 1);
    delta %= mod;
  }
  long long aa = b + 1;
  long long tmp = 0;
  tmp = (((aa * aa) % mod) * aa) % mod;
  tmp -= (aa * (aa + 1) / 2) % mod;
  while (tmp < 0) tmp += mod;
  for (int i = 0; i < a; i++) {
    (result += tmp) %= mod;
    (tmp += delta) %= mod;
  }
  return result;
}
void solve() {
  int a, b;
  cin >> a >> b;
  cout << hun(a - 1, b - 1) << "\n";
}
int main(int argc, const char* argv[]) {
  time_t start = clock();
  int t = 1;
  for (int i = 0; i < t; i++) solve();
  cerr << fixed << setprecision(6)
       << "Time: " << 1.0 * (clock() - start) / CLOCKS_PER_SEC << "\n";
  return 0;
}
