let [|a; b|] = stdin.ReadLine().Split " " |> Array.map int64 (a%1000000007L) * (b%1000000007L) % 1000000007L |> printfn "%d"