#define _USE_MATH_DEFINES #include <iostream> //cin, cout #include <vector> //vector #include <algorithm> //sort,min,max,count #include <string> //string,getline, to_string #include <cstdlib> //abs(int) #include <utility> //swap, pair #include <deque> //deque #include <climits> //INT_MAX #include <bitset> //bitset #include <cmath> //sqrt, ceil. M_PI, pow, sin #include <ios> //fixed #include <iomanip> //setprecision #include <sstream> //stringstream #include <numeric> //gcd, assumlate #include <random> //randam_device #include <limits> //numeric_limits using namespace std; constexpr long long int D_MOD = 1000000007; int main() { long long int A, B; cin >> A >> B; long long int ans = ((A % D_MOD) * (B % D_MOD)) % D_MOD; cout << ans << endl; return 0; }