x,y = map(int,input().split()) ans = int((x*y)%1000000007) print(ans)