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