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

public class Main {

    public static int phi(int n) {
        int result = n;
        for (int i = 2; i * i <= n; i++) {
            if (n % i == 0) {
                while (n % i == 0)
                    n /= i;
                result -= result / i;
            }
        }
        if (n > 1)
            result -= result / n;
        return result;
    }

    public static void main(String[] args) throws IOException {
        int a = sc.nextInt(); int b = sc.nextInt();
        long sum1 = 0, sum2 = 0;
        for (long k = 1; k <= a; k++) {
            sum1 += (k*b + 1)%MOD;
        }
        sum2 = ((long) b*(b-1)/2)%MOD;

        pw.println((sum1%MOD*sum2%MOD)%MOD);
        pw.close();
    }

    public static void pairSort(Pair[] arr) {
        ArrayList<Pair> l = new ArrayList<>();
        Collections.addAll(l, arr);
        Collections.sort(l);
        for (int i = 0; i < arr.length; i++) {
            arr[i] = l.get(i);
        }
    }
    public static void longSort(long[] arr) {
        ArrayList<Long> l = new ArrayList<>();
        for (long i : arr) l.add(i);
        Collections.sort(l);
        for (int i = 0; i < arr.length; i++) {
            arr[i] = l.get(i);
        }
    }
    public static void intSort(int[] arr) {
        ArrayList<Integer> l = new ArrayList<>();
        for (int i : arr) l.add(i);
        Collections.sort(l);
        for (int i = 0; i < arr.length; i++) {
            arr[i] = l.get(i);
        }
    }

    static class Pair implements Comparable<Pair> {
        long N; int cnt; boolean stop;
        public Pair(long first, int second, boolean third){
            this.N = first; this.cnt = second; this.stop = third;
        }

        @Override
        public int compareTo(Pair o) {
            return 0;
        }
    }
    static class Edge implements Comparable<Edge> {
        int node, w;

        Edge(int node, int w) {	this.node = node; this.w = w; }

        public int compareTo(Edge e) { return w - e.w; }

        @Override
        public String toString() {
            return "("+ node +","+w+")";
        }
    }
    static class Triple {
        int x, y, z;

        Triple(int a, int b, int c) { x = a; y = b; z = c;}


        //        public int compareTo(Triple t)
//        {
//            if(Math.abs(sum - t.sum) < 1e-9) return x > t.x ? 1 : -1;
//            return sum > t.sum ? 1 : -1;
//        }
        public String toString()
        {
            return "(" + x + ", " + y  + ", " + z + ")";
        }
    }

    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

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

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

        public long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        public String nextLine() throws IOException {
            return br.readLine();
        }

        public double nextDouble() throws IOException {
            String x = next();
            StringBuilder sb = new StringBuilder("0");
            double res = 0, f = 1;
            boolean dec = false, neg = false;
            int start = 0;
            if (x.charAt(0) == '-') {
                neg = true;
                start++;
            }
            for (int i = start; i < x.length(); i++)
                if (x.charAt(i) == '.') {
                    res = Long.parseLong(sb.toString());
                    sb = new StringBuilder("0");
                    dec = true;
                } else {
                    sb.append(x.charAt(i));
                    if (dec)
                        f *= 10;
                }
            res += Long.parseLong(sb.toString()) / f;
            return res * (neg ? -1 : 1);
        }

        public boolean ready() throws IOException {
            return br.ready();
        }

        public int[] nextIntArr(int n) throws IOException {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = Integer.parseInt(next());
            }
            return arr;
        }

        public long[] nextLongArr(int n) throws IOException {
            long[] arr = new long[n];
            for (int i = 0; i < n; i++) {
                arr[i] = Long.parseLong(next());
            }
            return arr;
        }

    }
    static PrintWriter pw = new PrintWriter(System.out);
    static Scanner sc = new Scanner(System.in);
    static Random random = new Random();
    static final long MOD = 1_000_000_000 + 7;
    static final int INF = (int) 1e9;
}