import java.util.Scanner; class no666{ public static void main(String[] args) { Scanner stdIn=new Scanner(System.in); long a,b; a=stdIn.nextLong(); b=stdIn.nextLong(); System.out.print(a*b%1000000007); } }