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