m = 1000000007 a, b = [int(x)%m for x in input().split()] ans = (a*b)%m print(ans)