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.IOException;
import java.io.OutputStreamWriter;
import java.io.BufferedWriter;
import java.util.InputMismatchException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.math.BigInteger;
import java.io.InputStream;

public class SolC {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskSolver solver = new TaskSolver();
        solver.solve(1, in, out);
        out.close();
    }
}

class TaskSolver {

    public void solve(int testNumber, InputReader in, OutputWriter out) {
        long a = in.nextInt();
        long b = in.nextInt();

        long modu = 1000000007;

        // out.println((a*(a+1)/2*b+a)*b*(b-1)/2);

        /*don't use this two part strategy. do it incrementally.*/
    
        long first = b * (b-1) / 2;
        first %= modu;

        long second = a * (a+1) / 2;
        second %= modu;
        second  = second*b + a;
        second %= modu;

        System.out.println((first * second)%modu);


    }

}

/*
    int in.nextInt()
    String in.nextString()

    out.print(n + " ") //must be " " which is a String object.
    out.close()
*/
class InputReader {
    InputStream stream;
    byte[] buf = new byte[1024];
    int curChar, numChars;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    private int read() {

        if (numChars == -1)
            throw new InputMismatchException();
        //buffer wraps around here. Hence the buf array size does not matter.
        /*
        if the buffer size is enough, i.e 1024. InputStream load at most 1024 bytes(if necessary)
        into buffer. read() returns 1 byte every time. After the first read, it only needs to
        return corresponding byte in the buf every time it is called. it does not have to call
        input stream to read again.
        Only if the bug has run out does InputReader has to call stream.read(buf) to reload the
        buf.
        */
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }


    public int nextInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public String nextString() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuffer res = new StringBuffer();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    private boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

}

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 println(Object... objects){
        print(objects);
        print("\n");
    }

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

}