A,B = [int(i) for i in input().split()] print((A%1000000007)*(B%1000000007)%1000000007)