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