using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication16
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            int A = int.Parse(Console.ReadLine());
            int[] a = { 5, 4, 3 };
            if (N / A < 3)
                Console.WriteLine(-1);
            else
            {
                for (int i = 0; i < 3; i++)
                {
                    if(N/2*A >= a[i])
                    {

                    }
                }
            }
            Console.ReadLine();
        }
    }
}