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.*;
import java.io.*;

public class Sequence implements Runnable {
	// x = b * div(x, b) + mod(x,b)
        // x = bk mod(x,b) + mod(x,b) by equatio given in problem
        // x = mod(x, b)       (bk + 1)
        // x = (b * (b-1) / 2) (bk + 1)
        // since k = [1,a]
        // x = (b * (b - 1) / 2) ((b+1)+ (b+2) +....+(ab+1))
        // x = (b * (b - 1) / 2) ((b) + (2b) + ... (ab) + a)
        //taking out b
        // x = (b * (b - 1) / 2) (b (a * (a + 1) / 2) + a)
        //DONE
	public void solve() throws IOException {
		long a  = nextInt();
                long b = nextInt();
                long MOD = 1000000007;
                
                long first = (b * (b - 1) / 2) % MOD;
                long second = (a * (a + 1) / 2) % MOD;
                
                long answer = first * ((a + b * second) % MOD);
                answer %= MOD;
                
                System.out.println(answer);
	}

	
	
	
	
	
	
	
	
	

	
	
	
	
	
	
	
	
	//-----------------------------------------------------------
	public static void main(String[] args) {
		new Sequence().run();
	}

        public void print1Int(int[] a){
                for(int i = 0; i < a.length; i++)
                        System.out.print(a[i] + " ");
                System.out.println();
        }
        
        public void print2Int(int[][] a){
                for(int i = 0; i < a.length; i++){
                        for(int j = 0; j < a[0].length; j++){
                                System.out.print(a[i][j] + " ");
                        }
                        System.out.println();
                }
        }
        
	public void run() {
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			tok = null;
			solve();
			in.close();
		} catch (IOException e) {
			System.exit(0);
		}
	}

	public String nextToken() throws IOException {
		while (tok == null || !tok.hasMoreTokens()) {
			tok = new StringTokenizer(in.readLine());
		}
		return tok.nextToken();
	}

	public int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	public long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	public double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	BufferedReader in;
	StringTokenizer tok;
}