A, B = map(int, input().split()) mod = 1000000007 print((A*B)%mod)