a,b = gets.chomp.split(" ").map(&:to_i) puts a * b % 1000000007