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