a, b = gets.chomp.split.map(&:to_i) N = 10**9 + 7 puts (a % N * b % N) % N