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