3033.Dreamoon and Sums

Time Limit: 1s Memory Limit: 256MB

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 3033_1.png and 3033_2.png, where k is some integer number in range [1,a].By 3033_3.png we denote the quotient of integer division of x and y. By 3033_4.png 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 1000000007 (109+7). Can you compute it faster than Dreamoon?

Input Format(From the terminal/stdin)

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

Output Format(To the terminal/stdout)

Output Print a single integer representing the answer modulo 1000000007 (109+7).

Sample Input 1

Copy
1 1
 · \n

Sample Output 1

Copy
0
 \n

Sample Input 2

Copy
2 2
 · \n

Sample Output 2

Copy
8
 \n

Hints

For the first sample, there are no nice integers because 3033_5.png is always zero.For the second sample, the set of nice integers is {3,5}.

Submit

请先 登录

© 2025 FAQs