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.awt.*;
import java.io.*; 
import java.math.*;
import java.util.*;
import java.util.Map.Entry;

import static java.lang.Math.*; 
   
public class solver implements Runnable { 
        final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null; 
        BufferedReader in; 
        PrintWriter out; 
        StringTokenizer tok = new StringTokenizer(""); 
        
        boolean HasTokens(){
            while(!tok.hasMoreTokens()){ 
                try{ 
                        tok = new StringTokenizer(in.readLine()); 
                }catch (Exception e){ 
                        return false; 
                } 
            }
            return true;
        }
          
        String readString() throws IOException{                 
            return HasTokens() ? tok.nextToken():null; 
        } 
        String readString(String delim) throws IOException{ 
            return HasTokens() ? tok.nextToken(delim):null;
        } 
         
        int readInt() throws IOException{ 
            return Integer.parseInt(readString()); 
        }   
        long readLong() throws IOException{ 
            return Long.parseLong(readString()); 
        }       
        double readDouble() throws IOException{ 
            return Double.parseDouble(readString()); 
        }  
        char readChar() throws IOException { 
            char val = 0; 
            do{ 
                val = (char) in.read(); 
            }while(val == '\n' || val == '\r'); 
            return val; 
        } 
//----------------------------------        
          
        public class Pair<T1,T2> { 
            public T1 x1; 
            public T2 x2; 
            public Pair(){}; 
            public Pair(T1 x1, T2 x2){ 
                this.x1 = x1; 
                this.x2 = x2; 
            } 
            public String toString(){ 
                return x1 + ":" + x2; 
            } 
        }  
        
        public class Three implements Comparable<Three>{ 
            public int x1, x2, x3; 
            public Three(){} 
            public Three(int a, int b, int c){x1 = a;x2=b;x3=c;} 
            public int compareTo(Three o) {//               
                if(x1 == o.x1 && x2 == o.x2) return x3-o.x3;
                if(x1 == o.x1) return x2-o.x2;
                return (x1-o.x1);  
                // (x1-o.x1) - increase; -(x1-o.x1) - decrease 
            } 
            public String toString(){ 
                return x1 + ":" + x2 + ":" + x3; 
            } 
        } 


//----------------------------------------
        
        int mod = (int)1e9+7;
        
        long s1(long a, long b){       	

			long res1 = (((a*(a+1)/2)%mod)*b + a)%mod;
        	//long res1 = (a*((b*(a+1)+2)%mod)/2)%mod;
        	
        	long res2 = ((b-1)*b/2)%mod;
        	
        	long res = (res1*res2)%mod;
        	
        	return res;
        }
        
        long s2(long a, long b){
        	
        	long res = 0;
        	
        	long x = 0;
        	while(true){
        		x++;
        		if (x%b == 0) continue;
        		
        		long z = (x/b)/(x%b);
        		
        		if ((x/b)%(x%b) == 0)
        			if (1 <= z && z <= a)
        				res = (res+1)%mod;
        			else break;
        	}
        	
        	return res;	
        }
        

        void solve() throws NumberFormatException, IOException {
        	
        	long a = readInt();
        	long b = readInt();       	
        	
        	
        	out.println(s1(a, b));
        	
        }
        
//---------------------------------------- 
        public static void main(String[] args){ 
            new Thread(null, new solver(), "", 256 * (1L << 20)).start(); 
        } 
         
        public void run(){ 
                try{ 
                        timeBegin = System.currentTimeMillis(); 
                        try{ 
                            if (ONLINE_JUDGE){ 
                                in = new BufferedReader(new InputStreamReader(System.in)); 
                                out = new PrintWriter(System.out);
                            }  
                            else { 
                                in = new BufferedReader(new FileReader("input.txt")); 
                                out = new PrintWriter("output.txt"); 
                            } 
                        }catch(Throwable e){
                            in = new BufferedReader(new InputStreamReader(System.in)); 
                            out = new PrintWriter(System.out); 
                        }
                          
                        solve(); 
                        out.close(); 
                          
                        timeEnd = System.currentTimeMillis(); 
                        System.err.println("Time = " + (timeEnd - timeBegin)); 
                }catch (Exception e){ 
                        e.printStackTrace(System.err); 
                        System.exit(-1); 
                } 
        } 
         
        long timeBegin, timeEnd; 
}