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