#include int main(){ int x,y,z; scanf("%d %d",&x,&y); z=(x%1000000007)*(y%1000000007); printf("%d\n",z%1000000007); }