The General Petrenko interested in the question: What is the greatest integer N multiple of M, can be displayed on the device constructed using the K light-emitting diodes? The number of light-emitting diodes needed to display each of the figures shown.
In one line given two integers K and M through the gap (1 ≤ K ≤ 100, 1 ≤ M ≤ 3000).
Remove only the number N - the answer to the general question. If the solution does not exist, output a -1.