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