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