#include int main(void){ long int a,b; scanf("%ld%ld",&a,&b); printf("%ld\n",(a*b)%1000000007); return 0; }