#include #define c 1000000007 using namespace std; int main() { long long a,b; cin >> a >> b; cout << ((a % c) * b) % c << endl; return 0; }