#include <bits/stdc++.h>
using namespace std;
int main(){
  int A, B;
  cin >> A >> B;
  cout << (long long) A * B % 1000000007 << endl;
}