import java.util.*; import java.lang.*; import java.io.*; // The main method must be in a class named "Main". class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println(((sc.nextInt() % 1000000007) * (sc.nextInt() % 1000000007)) % 1000000007); } }