A,B =map(int,input().split()) n = 10**9 +7 A =A % n B =B % n ans = (A*B)%n print(ans)