#include int main(void){ long long A , B; std::cin >> A >> B; std::cout << (A*B) % 1000000007 << std::endl; return 0; }