a, b = map(int, input().split()) mod = 10**9 + 7 print(a * b % mod)