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.List;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.RoundingMode;
import java.util.*;

public class Watermelon {
	public static void main(String[] args) throws IOException{
		Main m=new Main();
		m.solve();
	}
	}
class Main{
	
	static int[] temp=new int[100];
	 BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
	 private int[] array;
	    private int[] tempMergArr;
	    private int length;
	
	   
	    StringTokenizer stringTokenizer;

	     String next() throws IOException {
	        while (stringTokenizer == null || !stringTokenizer.hasMoreTokens()) {
	            stringTokenizer = new StringTokenizer(reader.readLine());
	        }
	        return stringTokenizer.nextToken();
	    }

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

	    long nextLong() throws IOException {
	        return Long.parseLong(next());
	    }
	    int n=0;
	    ArrayList<Counti> list=new ArrayList<>();
	    void solve() throws IOException  {

			int mod = 1000000007;
			Scanner scan = new Scanner(System.in);
			long a=scan.nextInt(),b= scan.nextInt();
			long answer = 0;
			for(long i=1;i<=a;i++)
			{
				long c = (i*b+1)%mod;
				long d = (b*(b-1)/2)%mod;
				answer=(answer+c*d)%mod;
			}
			System.out.println(answer);
	    }
	    public  int dp(int i,int count){
	    	System.out.println(i+" "+count);	  
	    	if((i)==list.size()||count==0)
	    		{System.out.println("Hey");return 0;}
	        int choice1=dp(i+1,count);
	    	int choice2=0;
	    //	if(i!=(list.size()-1))
	   // 	System.out.println(list.get(i).j+" "+list.get(i+1).j);
	        int x=dp(i+1,count-1);
	        if(i+1<list.size()){
	    	if(list.get(i).j<=list.get(i+1).i)
    		    choice2+=(x+(list.get(i).i+list.get(i).j));
	    	else
	    		choice2=(list.get(i).i+list.get(i).j);
	        }
	        else
	        	choice2=(list.get(i).i+list.get(i).j);
	  //      if(i==list.size()-1)
	   //     	choice2+=(dp(i+1,count-1)+(list.get(i).i+list.get(i).j));
	    	System.out.println(choice2);
	     return Math.max(choice1,choice2);
	    }
	      
	      public static double median(double[] m) {
	    	    int middle = m.length/2;
	    	    if (m.length%2 == 1) {
	    	        return m[middle];
	    	    } else {
	    	        return (m[middle-1] + m[middle]) / 2.0;
	    	    }
	    	}
	      private static int add(int x,int y){
	    	  if(x==0&&y==1)
	    		  return 1;
	    	  if(x==1&&y==0)
	    		  return 1;
	    	  if(x==0&&y==0)
	    		  return 0;
	    	  if(x==1&&y==1)
	    		  return 0;
	    	   return 0;
	      }
	      private static int[] column(int[] arr){
	    	  for(int i=0;i<arr.length;i++)
	    		  arr[i]=(1-arr[i]);	 
	    	  return arr;
	      }
          private static int[] row(int[] arr){
        	  for(int i=0;i<arr.length;i++)
	    		  arr[i]=(1-arr[i]);
        	  return arr;
          }
	private static int gcd(int a, int b)
	{
	    while (b > 0)
	    {
	    	int temp = b;
	        b = a % b; // % is remainder
	        a = temp;
	    }
	    return a;
	}
	private static int lcm(int a, int b)
	{
	    return a * (b / gcd(a, b));
	}
	static int[] toFractionPos(int x,int y){
		int a=gcd(x,y);
		int[] arr={x/a,y/a};
		//display(arr);
		return arr;
	}
   
	static void display(int[][] arr){
		for(int i=0;i<arr.length;i++){
			for(int j=0;j<arr[i].length;j++){
				System.out.print(arr[i][j]+" ");
		}
			System.out.println();
		}
		System.out.println();
	}

	 static void display(String[] arr){
			for(int i=0;i<arr.length;i++){
				System.out.println(arr[i]+" ");
			}	
			//System.out.println();
		
	 }
	 static void display(int[] arr){
		 for(int i=0;i<arr.length;i++)
				System.out.print(arr[i]+" ");
		System.out.println();
		 }
		 static void display(double[] arr){
		 	   for(int i=0;i<arr.length;i++){
		 		   System.out.print(arr[i]+" ");
		 	   }
		 	   System.out.println();
	    }
	 static void display(char[] arr){
		// System.out.println();
		 int t=0;
			for(int i=0;i<arr.length;i++){
				if(arr[i]!='0'){t=i;break;}
			}	
			while(t!=arr.length){
				System.out.print(arr[t]);
				t++;
			}
			System.out.println();
		
		  }
	 static String str(char[] carr){
		 String str="";
		 for(int i=0;i<carr.length;i++){
			    str=str+carr[i];
			}
		 return str;
	 }
	    public void sort(int inputArr[]) {
	        this.array = inputArr;
	        this.length = inputArr.length;
	        this.tempMergArr = new int[length];
	        doMergeSort(0, length - 1);
	    }
	 
	    private void doMergeSort(int lowerIndex, int higherIndex) {
	         
	        if (lowerIndex < higherIndex) {
	            int middle = lowerIndex + (higherIndex - lowerIndex) / 2;
	            // Below step sorts the left side of the array
	            doMergeSort(lowerIndex, middle);
	            // Below step sorts the right side of the array
	            doMergeSort(middle + 1, higherIndex);
	            // Now merge both sides
	            mergeParts(lowerIndex, middle, higherIndex);
	        }
	    }
	 
	    private void mergeParts(int lowerIndex, int middle, int higherIndex) {
	 
	        for (int i = lowerIndex; i <= higherIndex; i++) {
	            tempMergArr[i] = array[i];
	        }
	        int i = lowerIndex;
	        int j = middle + 1;
	        int k = lowerIndex;
	        while (i <= middle && j <= higherIndex) {
	            if (tempMergArr[i] <= tempMergArr[j]) {
	                array[k] = tempMergArr[i];
	                i++;
	            } else {
	                array[k] = tempMergArr[j];
	                j++;
	            }
	            k++;
	        }
	        while (i <= middle) {
	            array[k] = tempMergArr[i];
	            k++;
	            i++;
	        }
	 
	    }
}


 class  Count implements Comparable {
    	    String i;
    	    String j;
    	    String k;
    	    String l;
    	    Count(String i,String j){
    	        this.j=j;
    	        this.i=i;
    	        this.l=j;
    	        this.k=i;
        }
    	    void display(){
    	    	System.out.println(i+" "+j);
    	    }
    	    
    	    	@Override
    		public int compareTo(Object o) {
    			// TODO Auto-generated method stub
    			Count c=(Count)o;
    			if(j.compareTo(j)>0)
    				return 1;
    			else if(j.compareTo(j)<0)
    				return -1;
    			else{
    				return 0;
    				
    			}
    		}
    		
    	}

 class  Counti implements Comparable {
    	    Integer i;
    	    int j;
    	    Counti(int i,int j){
    	        this.j=j;
    	        this.i=i;
    	    }
    	    void display(){
    	    	System.out.println(i+" "+j);
    	    }
    	    
    	    	@Override
    		public int compareTo(Object o) {
    			// TODO Auto-generated method stub
    			Counti c=(Counti)o;
    			if(i.compareTo(c.i)>0)
    				return 1;
    			else if(i.compareTo(c.i)<0)
    	    		return -1;
    			else
    				return 0;
    		}
    		
    	}
		
 class Extra{
	 ArrayList<Integer> list=new ArrayList<>();
	 
	 void display(){
		 System.out.println(list.size());
		 for(int i=0;i<list.size();i++){
			 System.out.print(list.get(i)+" ");
		 }
		 System.out.println();
	 }
 }



