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