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}.
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;


public class P476C 
{
	public static long multiplyRemaider(long a, long b, long mod) {
		long ret = 0;
		for (int i = 0; i < 63; i++) {
			if ((a & 1) == 1) {
				ret += b;
				ret %= mod;
			}
			a >>>= 1;
			b <<= 1;
			b %= mod;
		}
		return ret;
	}
	public static void main(String[] args) {
		try {
			BufferedReader fin = new BufferedReader(new InputStreamReader(System.in));
			StringTokenizer sc = new StringTokenizer(fin.readLine());
			long a = Long.parseLong(sc.nextToken());
			long b = Long.parseLong(sc.nextToken());
			fin.close();
			
			long mod = 1000000007 * 2;
			// 10000000 10000000
			// 425362313
			// -----------------
			// 10000000 9999999
			// 930564389
			
			// the result is a * ((b - 1) * b / 2) * ((a + 1) * b / 2 + 1)
			
			// compute r1 = (a + 1) * b + 2
			long r1 = multiplyRemaider(a + 1, b, mod);
//			System.out.println("r1: " + Long.toString(r1));
			r1 += 2;
			
			// compute r2 = (b - 1) * b / 2
			long b1 = b % 2 == 0 ? b - 1 : (b - 1) / 2;
			long bb = b % 2 == 0 ? b / 2 : b;
			long r2 = multiplyRemaider(b1, bb, mod);
//			System.out.println("r2: " + Long.toString(r2));
			
			// r3 = a * r2
			long r3 = multiplyRemaider(a, r2, mod);
//			System.out.println("r3: " + Long.toString(r3));
			
			// compute r4 = r1 * r3
			long r4 = multiplyRemaider(r1, r3, mod);
			r4 >>>= 1;
			
			System.out.println(Long.toString(r4));
		} catch (Exception e) {
			e.printStackTrace();
		}
		System.exit(0);
	}
}
