A, B = [int(x) for x in raw_input().split()] print A * B % 1000000007