a,b=map(int,input().split()) mod=10**9+7 a%=mod b%=mod print((a*b)%mod)