import java.util.Scanner; public class Main { static long t = 0; public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (sc.hasNext()) { solve(sc.nextLine()); // System.gc(); } System.out.println(t); sc.close(); } public static void solve(String input) { if (input.split(" ").length == 1) { input = null; return; } long s = Long.valueOf(input.split(" ")[0]); long k = Long.valueOf(input.split(" ")[1]); input = null; if (s % 2 == 0) { t += (s / 2) * k; } else { t += (s + 1) / 2 * k; } t = t % 1000000007; } }