using System.Linq; using static System.Console; namespace App { class Prog { static void Main() { int[] x = ReadLine().Split().Select(int.Parse).ToArray(); int mod = 1000000007; WriteLine((x[0] % mod * x[1] % mod) % mod); } } }