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.math.BigInteger;


public class DreamonSums {

	/**
	 * @param args
	 */
	public static void main(String[] args) throws Exception{
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] input = new String[2];
		input = br.readLine().split(" ",2);
       BigInteger a = new BigInteger(input[0]);
       BigInteger b = new BigInteger(input[1]);
       BigInteger modulo = new BigInteger("1000000007");
       BigInteger two = BigInteger.ONE.add(BigInteger.ONE);
       
  /*     BigInteger len = a.multiply(b.multiply(b));
       BigInteger i = b.add(BigInteger.ONE);
       BigInteger sum = BigInteger.ZERO;
       BigInteger temp;
       
       while(i.compareTo(len) < 0)
       {
    	   if(i.mod(b).compareTo(BigInteger.ZERO) == 0)
    	   {
    		   i = i.add(BigInteger.ONE);
    		   continue;
    	   }
    	   
    		temp = i.divide(b).divide(i.mod(b));
    		if(temp.compareTo(a) <= 0 && temp.compareTo(BigInteger.ZERO) != 0)
    		{
    			sum = sum.add(i).mod(modulo);
    		}
    		i = i.add(BigInteger.ONE);
       }*/
       	
       //BigInteger sum = (a.add(a.multiply(a.add(BigInteger.ONE)).divide(two).multiply(b)).mod(modulo))
    	//	   .multiply(b.multiply(b.subtract(BigInteger.ONE)).mod(modulo).divide(two)).mod(modulo);
       
       //(a+ab(a+1)/2)*b(b-1)/2
       
       BigInteger asum = a.multiply(a.add(BigInteger.ONE)).divide(two); //asum = a(a+1)/2
       BigInteger bsum = b.multiply(b.subtract(BigInteger.ONE)).divide(two); // bsum = b(b-1)/2
       
       BigInteger sum = (a.add(b.multiply(asum))).multiply(bsum).mod(modulo); // sum = (a + b*asum)*bsum
       
       System.out.println(sum.toString());
       
       /*final int MOD = 1000000007;

    public void solve() throws IOException {
        long a = in.nextInt(), b = in.nextInt();
        long res = ((((b * (b - 1) / 2) % MOD)) % MOD) * a + ((((b) % MOD) * ((b * (b - 1) / 2) % MOD)) % MOD) * ((a * (a + 1) / 2) % MOD);
        out.println(res % MOD);*/

	}

}
