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 $\operatorname{mod}(x, b) \neq 0$ and $\frac{\operatorname{div}(x, b)}{\operatorname{mod}(x, b)} = k$, where k is some integer number in range [1, a].

By $\operatorname{div}(x, y)$ we denote the quotient of integer division of x and y. By $\operatorname{mod}(x, y)$ 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 (10^9 + 7). Can you compute it faster than Dreamoon?


-----Input-----

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


-----Output-----

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


-----Examples-----
Input
1 1

Output
0

Input
2 2

Output
8



-----Note-----

For the first sample, there are no nice integers because $\operatorname{mod}(x, 1)$ is always zero.

For the second sample, the set of nice integers is {3, 5}.

Difficulty: interview

Starter code:

Solutions:
a,b=map(int,input().split())
print(((b-1)*a*b//2+(a+1)*a*b*b*(b-1)//4)%1000000007)

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

(a, b) = list(map(int, input().split()))

# ans = a * a * (a - 1) * (a + 1) * b
# ans //= 4
# ans += a * (a - 1)

ans = a * (a + 1) * b * b * (b - 1)
ans //= 4
ans += a * b * (b - 1) // 2

MOD = 1000000007
ans %= MOD

print(ans)



load = [int(i) for i in input().split()]
a = load[0]
b = load[1]
print(b * (b - 1) // 2 * (b * a * (a + 1) // 2 + a) % 1000000007)





'''
Created on Oct 12, 2014

@author: Ismael
'''

#import time

MOD = 10**9+7
def sumTermsArith1(firstTerm,r,nbTerms):
    return (nbTerms*(2*firstTerm+(nbTerms-1)*r))//2

def solve(a,b):
    s = 0
    for rem in range(1,b):
        reason = rem*b
        s = (s+sumTermsArith1(reason+rem,reason,a))%MOD
    return s

def solve2(a,b):
    reason = a*(b*(a+1)+2)//2
    return sumTermsArith1(reason,reason,b-1)%MOD

#t = time.clock()
a,b = list(map(int,input().split()))
#sol1 = solve(a,b)
sol2 = solve2(a,b)
print(sol2)
#print(sol1 == sol2)
#print(time.clock()-t)


M = 1000000007
a,b = list(map(int, input().split(' ')))
res = b*(b-1)//2*(a+b*a*(a+1)//2)%M
print(res)


a,b = map(int, input().split())


sum = 0
mod = 1000000007

def c(i):
	mi = i * b + i
	ma = i * b * a + i

	return ((mi+ma) * a)//2 

sum = (((c(1) + c(b-1))*(b-1))//2)%mod

print(sum)

def main():
	a,b=map(int,input().split(" "))
	if b == 1:
		print ("0")
		return
	k=((a+1)*a)//2
	z=(k*b+a)
	z*=(b*(b-1))//2
	print (z%((10**9)+7))
	pass

main()

a, b = map(int, input().split())
print((b * (b - 1) * a * (a * b + b + 2) // 4)  % 1000000007)

a,b=list(map(int,input().split()))

dangbra=(b*(b-1)//2)*(a*(a+1)//2)*b+(b*(b-1)//2)*a


print(int(dangbra%1000000007))


#input
a,b=map(int,input().split())

#variables
nicesum=(b*(b-1)//2)*(a*(a+1)//2)*b+(b*(b-1)//2)*a

#main
print(int(nicesum%1000000007))



a, b = map(int, input().split())
n = 10**9+7
# print(a, b)
print(((b-1)*b*a//2+a*(a+1)*b*b*(b-1)//4)%n)
"""print((b-1)*b*a//2)
print((b-1)*b*a/2)
print((b-1)*b*a//2==(b-1)*b*a/2)
print(a*(a+1)*b*b*(b-1)//4)
print(a*(a+1)*b*b*(b-1)/4)
print(a*(a+1)*b*b*(b-1)//4 == a*(a+1)*b*b*(b-1)/4)

# print(((b-1)*a*b//2+(a+1)*a*b*b*(b-1)//4)%1000000007)"""

a,b = map(int, input().split())


sum = 0
mod = 1000000007

def c(i):
    mi = i * b + i
    ma = i * b * a + i

    return ((mi+ma) * a)//2 

sum = (((c(1) + c(b-1))*(b-1))//2)%mod

print(sum)

a = input().split()
for i in range(len(a)):
	a[i] = int(a[i])
s = a[1]*(a[1]-1)//2
s1 = a[0] + (a[0]*(a[0]+1)//2)*a[1]
s = s*s1;
s = s%1000000007
print(s)


mod = 10**9 + 7

def sum(x):
	return x * (x + 1) // 2

def solve():
	a, b = list(map(int, input().split()))
	print((sum(b - 1) * (b * sum(a) + a)) % mod)

solve()



def S(n):
    return n * (n + 1) // 2

def result(a, b):
    return S(b-1)*b*S(a) + S(b-1)*a

a, b = list(map(int, input().split()))
mod = 10**9 + 7
print(result(a, b) % mod)



a, b = map(int, input().split())

print (
   (((b-1)*b//2) *
   (b*a*(a+1)//2+a)) % (10**9+7)
   )

a, b = [int(i) for i in input().split()]
x = b * (b - 1) // 2
y = b * a * (a + 1) // 2 + a
print(x * y % (10 ** 9 + 7))

a, b = tuple(map(int, input().split()))
print((b*(b-1)*a*(a+1)*b//4 + a*b*(b-1) // 2) % 1000000007)

#d = div (x,b)
#m = mod (x,b)
#x = d*b + m = kmb + m
#значит m любое, k любое, им всегда найдётся соответствующее x.
#m может меняться от b-1, k может меняться от 1 до a
#sum (x) = sum(1..b-1) * m * sum (1..a) * k * b + sum (1..b-1)*m
#sum (x) = sum (1..a) sum (1..b-1) просуммировать: kmb + m
#sum (x) = sum (b-1) * m * sum (1..a) просуммировать: bk + 1
#S(b-1) * (b * S(a) + a)

def S (n):
    return n*(n+1)//2
#
string = input ()
string_list = string.split ()
a,b = int (string_list[0]),int (string_list[1])
itog = S(b-1)* (S(a)*b + a)
itog = int (itog % 1000000007)
print (itog)

a,b = list(map(int,input().split(' ')))
res = a*(a*b+b+2)*(b-1)*b//4
md = 10**9 + 7
print(res%md)

a, b = map(int, input().split())
print((((b * a * (a + 1) >> 1) + a) * (b - 1) * b >> 1) % 1000000007)

a, b = (input()).split(' ')

a = int(a)
b=int(b)

result = a*b*(b-1)*(a*b+b+2)//4
#result = int(result)
result = result % ( 10**9 +7)
print(result)

a, b = list(map(int, input().split()))
print((a * b * (b - 1) // 2 + b ** 2 * (b - 1) // 2 * a * (a + 1) // 2) % (10 ** 9 + 7))