#include<iostream>
using namespace std;
using ll = long long;
int main()
{
ll A,B;
cin >> A>>B;
cout << (A*B)%1000000007 << endl;
return 0;
}