#include <iostream>
using namespace std;

int main(void){
	long long A,B;

	cin>>A>>B;

	cout<<(A*B)%1000000007<<endl;

	return 0;
}