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.util.List;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.util.Arrays;
import java.io.BufferedWriter;
import java.util.ArrayList;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.util.StringTokenizer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Lokesh Khandelwal
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		OutputWriter out = new OutputWriter(outputStream);
		TaskC solver = new TaskC();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskC {
    public void solve(int testNumber, InputReader in, OutputWriter out) {
        long a = in.nextInt(), b = in.nextInt();
        int i;
        long ans = 0, MOD = (long)1e9 + 7, k, k1, two = IntegerUtils.extededGCD(MOD, 2)[0];
        long q = (a * (a + 1)) % MOD;
        q = (q * two) % MOD;
        q = (q * b) % MOD;
        q = (q + a) % MOD;
        //DebugUtils.print(two);
        //BigInteger f, f1, f2;
        for(i=1;i<b;i++) {
            /*k = (i * a) % MOD;
            k1 = (k * i) % MOD;
            k = (k * (k + 1)) % MOD;
            k = (k * two) % MOD;
            k = (k * b) % MOD;   
            ans = (k1 + k + ans) % MOD; */
            k = (i * q) % MOD;
            ans = (ans + k) % MOD;
            /*f = BigInteger.valueOf(i * a);
            f1 = f.multiply(BigInteger.valueOf(i));
            f = f.multiply(f.add(BigInteger.ONE));
            f = f.divide(BigInteger.valueOf(2));
            f = f.multiply(BigInteger.valueOf(b));
            f = f.remainder(BigInteger.valueOf(MOD));
            f = f.add(f1);
            f = f.remainder(BigInteger.valueOf(MOD));
            ans2 = (ans2 + f.intValue())%MOD;*/
        }
        //DebugUtils.print(ans2);
        out.printLine(ans);
    }
}

class InputReader
{
    BufferedReader in;
    StringTokenizer tokenizer=null;

    public InputReader(InputStream inputStream)
    {
        in=new BufferedReader(new InputStreamReader(inputStream));
    }
    public String next()
    {
        try{
            while (tokenizer==null||!tokenizer.hasMoreTokens())
            {
                tokenizer=new StringTokenizer(in.readLine());
            }
            return tokenizer.nextToken();
        }
        catch (IOException e)
        {
            return null;
        }
    }
    public int nextInt()
    {
        return Integer.parseInt(next());
    }
}

class OutputWriter {
	private final PrintWriter writer;

	public OutputWriter(OutputStream outputStream) {
		writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
	}

	public OutputWriter(Writer writer) {
		this.writer = new PrintWriter(writer);
	}

	public void print(Object...objects) {
		for (int i = 0; i < objects.length; i++) {
			if (i != 0)
				writer.print(' ');
			writer.print(objects[i]);
		}
	}

	public void printLine(Object...objects) {
		print(objects);
		writer.println();
	}

	public void close() {
		writer.close();
	}
}

class IntegerUtils {

    public static int[] extededGCD(long MOD,long a)
    {
        long x=0,y=1,lastx=1,lasty=0,m1=MOD;
        while (MOD!=0)
        {
            long q=a/MOD,r=a%MOD;
            long m=lastx-q*x,n=lasty-q*y;
            lastx=x;
            lasty=y;
            x=m;
            y=n;
            a=MOD;
            MOD=r;
        }
        while (lastx < 0) {
            lastx += m1;
        }
        return new int[]{(int)lastx,(int)lasty};
    }
}

