l = list(map(int,input().split())) ans = (l[0] * l[1]) % 1000000007 print (ans)