# No.666 1000000007で割るだけ a, b = [int(i) for i in input().split()] print(a * b % 1000000007)