a, b = map(int, input().split()) mod = 1000000007 print(a*b%mod)