AB=input() AB=AB.rstrip().split(" ") A=int(AB[0]) B=int(AB[1]) print(A*B%1000000007)