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

public class xyz {
	public static void main(String[] args) {
		new xyz().solve();
	}

	FasterScanner in = new FasterScanner();
	PrintWriter out = new PrintWriter(System.out);

	long mod = (long) 1e9 + 7;

	public void solve() {
		long a = in.nextInt();
		long b = in.nextInt();
		long ans = 0;
		ans += ((b * (b - 1) / 2) % mod * a) % mod;
		ans %= mod;
		ans += a * (a + 1) / 2 % mod * ((b * (b - 1) / 2) % mod * b % mod) % mod;
		ans %= mod;
		out.print(ans);
		out.close();
	}

	public long sum(int n) {
		return (n * (n + 1) / 2) % mod;
	}

	class s implements Comparable<s> {
		int idx;
		int val;
		int pos;

		public s(int i, int v) {
			this.idx = i;
			this.val = v;
		}

		@Override
		public int compareTo(s o) {
			// TODO Auto-generated method stub
			if (this.val != o.val) {
				return Integer.compare(this.val, o.val);
			} else {
				return Integer.compare(this.idx, o.idx);
			}
		}
	}

	int[][] arr;
	boolean[][] visited;
	int cur = 1;
	int temp = 0;
	int ans = 0;
	int n, m;

	void dfs(int i, int j) {
		if (visited[i][j])
			return;
		visited[i][j] = true;

	}

	class Node {
		int x, y;

		public Node(int x, int y) {
			this.x = x;
			this.y = y;
		}

		ArrayList<Node> list = new ArrayList<>();
	}

	public static class FasterScanner {
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;

		public int read() {
			if (numChars == -1)
				throw new InputMismatchException();
			if (curChar >= numChars) {
				curChar = 0;
				try {
					numChars = System.in.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public String nextLine() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isEndOfLine(c));
			return res.toString();
		}

		private boolean isEndOfLine(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}

		public String nextString() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		private boolean isSpaceChar(int c) {
			return c == '\n' || c == '\r' || c == -1 || c == ' ' || c == '\t';
		}

		public long nextLong() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public int nextInt() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}

			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public double nextDouble() {
			return Double.parseDouble(nextString());
		}

		public int[] nextIntArray(int n) {
			int[] arr = new int[n];
			for (int i = 0; i < n; i++) {
				arr[i] = nextInt();
			}
			return arr;
		}

		public long[] nextLongArray(int n) {
			long[] arr = new long[n];
			for (int i = 0; i < n; i++) {
				arr[i] = nextLong();
			}
			return arr;
		}

		public int[] nextIntArray10(int n) {
			int[] arr = new int[n + 1];
			for (int i = 1; i <= n; i++) {
				arr[i] = nextInt();
			}
			return arr;
		}

		public long[] nextLongArray10(int n) {
			long[] arr = new long[n + 1];
			for (int i = 1; i <= n; i++) {
				arr[i] = nextLong();
			}
			return arr;
		}

		public int[] nextIntArray11(int n) {
			int[] arr = new int[n + 2];
			for (int i = 1; i <= n; i++) {
				arr[i] = nextInt();
			}
			return arr;
		}

		public long[] nextLongArray11(int n) {
			long[] arr = new long[n + 2];
			for (int i = 1; i <= n; i++) {
				arr[i] = nextLong();
			}
			return arr;
		}
	}

}