
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class Main {

    private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    public static void main(String[] args) throws IOException {
        long[] a = readLongArray();
        long mod = 1000000007;
        long ans = a[0]*a[1];
        ans = ans%mod;
        System.out.println(ans);
    }


    private static int readInt() throws IOException {
        return Integer.parseInt(br.readLine());
    }

    private static int[] readIntArray() throws IOException {
        String[] in = br.readLine().split(" ");
        int[] inte = new int[in.length];
        for (int i = 0; i < in.length; i++) {
            inte[i] = Integer.parseInt(in[i]);
        }
        return inte;
    }

    private static List<Integer> readIntList() throws IOException {
        int[] a = readIntArray();
        List<Integer> al = new ArrayList<>();
        for (int i = 0; i < a.length; i++) {
            al.add(a[i]);
        }
        return al;
    }

    private static long[] readLongArray() throws IOException {
        String[] in = br.readLine().split(" ");
        long[] inte = new long[in.length];
        for (int i = 0; i < in.length; i++) {
            inte[i] = Long.parseLong(in[i]);
        }
        return inte;
    }
}
