using System; using System.Linq; namespace prob666 { class Program { static void Main(string[] args) { long[] c= Console.ReadLine().Split(' ').Select(long.Parse).ToArray(); long a = c[0]; long b = c[1]; long d = (a * b) % 1000000007; Console.WriteLine(d); } } }