import java.util.*;
import java.math.*;
import java.io.*;

public class Solution {
	public static void main (String[] args) {
	    FastScanner sc = new FastScanner(System.in);
	    int t = 1;
	    while(t-->0){
	        int n = sc.nextInt();
	        int m = sc.nextInt();
	        long ans = (2L*n*(m-1))%1000000007L;
	        System.out.println(ans);
	    }
	}
	static class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		FastScanner(File f) {
			try {
				br = new BufferedReader(new FileReader(f));
			} catch (FileNotFoundException e) {
				e.printStackTrace();
			}
		}

		FastScanner(InputStream f) {
			br = new BufferedReader(new InputStreamReader(f));
		}

		String nextLine() {
			try {
				return br.readLine();
			} catch (IOException e) {
				return null;
			}
		}

		String next() {
			while (st == null || !st.hasMoreTokens()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

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

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

		double nextDouble() {
			return Double.parseDouble(next());
		}

	}
}