using System;
internal class Program
{
    static void Main(string[] args)
    {
        string[] unos = Console.ReadLine().Split();
        int n = Convert.ToInt32(unos[0]);
        int k = Convert.ToInt32(unos[1]);
        bool prost = true;
        for(int i = 0; i * i < n; i++)
        {
            if(n % i == 0)
                prost = false;
        }
        if(prost && k == 2)
            Console.WriteLine(1 +" "+n);
        else
            Console.WriteLine(-1);
    }
}