#include int main() { unsigned long A,B; scanf("%lu %lu",&A,&B); printf("%lu\n",(A*B)%1000000007); return 0; }