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.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Scanner;
import java.util.Stack;
import java.util.StringTokenizer;

import javax.management.Query;

public class jjejsd {
	static class UnionFind {
		int[] p, rank;

		UnionFind(int N) {
			p = new int[N];
			rank = new int[N];
			for (int i = 0; i < N; i++)
				p[i] = i;
		}

		int findSet(int x) {
			return p[x] == x ? x : (p[x] = findSet(p[x]));
		}

		boolean union(int x, int y) {
			x = findSet(x);
			y = findSet(y);
			if (x == y)
				return false;

			if (rank[x] > rank[y])
				p[y] = x;
			else {
				p[x] = y;
				if (rank[x] == rank[y])
					++rank[y];
			}
			return true;
		}
	}

	static class Edge implements Comparable<Edge> {
		public int node; public long cost;

		Edge(int a, long b) {
			node = a;
			cost = b;
		}

		public int compareTo(Edge e) {
			if(cost - e.cost>0)
				return 1;
			else if(cost - e.cost==0)
				return 0;
			else
				return -1;
		}
	}

	static final long INF = (long) 1e17; // don't increase, avoid overflow
	static ArrayList<Edge>[] adjList;
	static HashSet<Long>[] h;
	static int V;

	/*
	 * 1. Dijkstra's Algorithm for SSSP on weighted graphs
	 */
	static long dijkstra(int S, int T) // O(E log E)
	{
		long[] dist = new long[V];
		Arrays.fill(dist, INF);
		PriorityQueue<Edge> pq = new PriorityQueue<Edge>();
		PriorityQueue<Integer> q = new PriorityQueue<Integer>();
		dist[S] = 0;
		pq.add(new Edge(S, 0));// may add more in case of MSSP (Mult-Source)
		while (!pq.isEmpty()) {
			Edge cur = pq.remove();
			if (cur.node == T) // remove if all computations are needed
				return dist[T];
			if (cur.cost > dist[cur.node]) // lazy deletion
				continue;
			for (Edge nxt : adjList[cur.node]) {
				while (h[cur.node].contains(cur.cost))
					cur.cost++;
				if (cur.cost + nxt.cost < dist[nxt.node]) {
					pq.add(new Edge(nxt.node, dist[nxt.node] = cur.cost + nxt.cost));
				}
			}
		}
		return -1;
	}

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		Scanner sc = new Scanner(System.in);
		long a=sc.nextLong();
		long b=sc.nextLong();
		long sum=0;
		long c=((b-1)*(b)/2)%1000000007;
//		System.out.println(c);
		for(int i=1;i<=a;i++) {
			sum = (sum+(((i%1000000007*b+1)%1000000007 )*c)%1000000007)%1000000007;
		}
		System.out.println(sum);
	}
}
