S=input().split(' ') A=int(S[0]) B=int(S[1]) print((A * B) % 1000000007 )