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>
using namespace std;
unsigned long long int gcd(unsigned long long int a, unsigned long long int b) {
  if (a == 0)
    return (b);
  else
    return (gcd(b % a, a));
}
bool x[1000001] = {false};
vector<unsigned long long int> prime;
set<unsigned long long int> vec;
map<unsigned long long int, bool> mp;
void primesebolo() {
  unsigned long long int i, j;
  for (i = 2; i * i <= 1e6; i++) {
    for (j = i * 2; j <= 1e6; j += i) {
      x[j] = true;
    }
  }
  for (i = 2; i <= 1e6; i++) {
    if (!(x[i])) prime.push_back(i);
  }
  for (i = 2; i * i <= 1e6; i++) {
    if (x[i] == false) {
      for (j = i * 2; j <= 1e6; j += i) {
        if ((i != (j / i)) && x[j / i] == false) {
          vec.insert(j);
        }
      }
    }
  }
  for (i = 2; i <= 100; i++) {
    if (x[i] == false) vec.insert(i * i * i);
  }
}
unsigned long long int fast(unsigned long long int n, unsigned long long int a,
                            unsigned long long int m) {
  if (n == 0)
    return (1);
  else if (n == 1)
    return (a);
  else {
    unsigned long long int r = fast(n / 2, a, m) % m;
    if (n % 2 == 0)
      return (((r % m) * (r % m)) % m);
    else
      return (((((r % m) * a) % m) * r) % m);
  }
}
unsigned long long int check(unsigned long long int n, unsigned long long int x,
                             unsigned long long int y) {
  unsigned long long int ok = 1;
  while (n != 0) {
    if ((n % 10) != x && (n % 10) != y) {
      ok = 0;
      break;
    }
    n /= 10;
  }
  return (ok);
}
const unsigned long long int N = 1e6 + 4;
unsigned long long int power(unsigned long long int a,
                             unsigned long long int n) {
  unsigned long long int prod = 1;
  for (unsigned long long int i = 1; i <= n; i++) {
    prod = prod * a;
  }
  return (prod);
}
int main() {
  unsigned long long int a, b;
  scanf("%lld%lld", &a, &b);
  unsigned long long int inv = fast(1e9 + 5, 2, 1e9 + 7);
  unsigned long long int p, q, r, s;
  p = ((a % 1000000007) * (b % 1000000007)) % 1000000007;
  p = ((p % 1000000007) * ((b - 1) % 1000000007)) % 1000000007;
  q = p;
  p = ((p % 1000000007) * (inv % 1000000007)) % 1000000007;
  q = ((q % 1000000007) * ((a + 1) % 1000000007)) % 1000000007;
  q = ((q % 1000000007) * (b % 1000000007)) % 1000000007;
  q = (q * fast(1e9 + 5, 4, 1e9 + 7)) % 1000000007;
  printf("%lld", (q % 1000000007 + p % 1000000007 + 1000000007) % 1000000007);
}
