# -*- coding: utf-8 -*- a,b = map(int,input().split()) print(a * b % 1000000007)