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.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.BitSet;
import java.util.Collections;
import java.util.HashSet;
import java.util.Map;
import java.util.Random;
import java.util.StringTokenizer;
import java.util.TreeMap;

public class solver {
    
    BufferedReader in;
    PrintWriter out;
    StringTokenizer tok;
    
    static final boolean OJ = System.getProperty("ONLINE_JUDGE") != null;
    
    void init() throws FileNotFoundException{
        if (OJ){
          in = new BufferedReader(new InputStreamReader(System.in));
          out = new PrintWriter(System.out);
//          in = new BufferedReader(new FileReader("sandwiches.in"));
//          out = new PrintWriter("sandwiches.out");
        }else{
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter("output.txt");
        }
    }
    
    String readString() throws IOException{
        while (tok == null || !tok.hasMoreTokens()){
            tok = new StringTokenizer(in.readLine()," :");
        }
        return tok.nextToken();
    }
    
    int readInt() throws NumberFormatException, IOException{
        return Integer.parseInt(readString());
    }
    
    double readDouble() throws NumberFormatException, IOException{
        return Double.parseDouble(readString());
    }
    
    long readLong() throws NumberFormatException, IOException{
        return Long.parseLong(readString());
    }
    long time;
    void run(){
        try{
            time = System.currentTimeMillis();
            init();
            solve();
            System.err.println(System.currentTimeMillis() - time);
            out.close();
            in.close();
        }catch (Exception e){
            e.printStackTrace();
        }
    }
    
    int gcd(int a, int b){
        if (a == 0) return b;
        return gcd(b % a, a);
    }
    
    int getNumberSum(long x){
        long sum = 0;
        while (x > 0){
            sum += x % 10;
            x /= 10;
        }
        return (int)sum;
    }
    
            
    void solve() throws NumberFormatException, IOException{
        int a = readInt();
        int b = readInt();
        long sum = 0;
        int mod = (int)1e9 + 7;
        BigInteger ba1 = BigInteger.valueOf((long)b*(a+1));
        BigInteger bia = BigInteger.valueOf(a);
        BigInteger two = BigInteger.valueOf(2);
        BigInteger bimod = BigInteger.valueOf(mod);
        
        long lba1 = (long)b*(a+1);
        
        
        for (int i=1;i<b;i++){          
            long ans1 = (long)i*a;
            long ans2 = (long) a * (a+1);
            ans2 /= 2;
            ans2 %= mod;
            ans2 *= i;
            ans2 %= mod;
            ans2 *= b;
            ans2 %= mod;
            
            long ans = (ans1 + ans2 ) % mod;
            
        
            sum = (sum + ans) % mod;
        }
        out.println(sum);
    }

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

}