By Kay Akashi
In order to strengthen his biceps brachii muscles, Kay is coming to the gym today. Kay now wants to use an EZ bar, a wavy bar to whose right and left ends he can add some weights. He holds this bar with both his arms, and flexes arms to build his muscles.
Today he wants to make the total weight kg. Luckily, he has found one weight of kg for the left end immediately. However, it seems that other kg weights are all unavailable, hence he needs to take several other available weights so that the total weight for the right end becomes kg too. In choosing weights, he wants to minimise the number of weights he has to take because he is too lazy to walk back and forth. Being horrible at maths, he asks his smart friend Alden to calculate the minimal number of weights he needs to take to make the total weight for the right end exactly kg. Report his answer.
Available weights are given as which is a single sequence of length ; , …, .
Also, if it's impossible to make kg out of , output instead.
, , . There's no such that .
.
.
The first line of input contains two integers, , . The second line of input contains integers, .
Output an answer in a single line.
5 16
2 4 4 8 10
3
One example of the solution is to pick up , , and . Another example is to pick up , , and . However, because there's no way to make by picking up only or elements, the minimal number of weights Kay needs to take is .
4 20
1 10 18 11
-1
Even Alden cannot find a set of weights to make kg out of this sequence. Thus, the answer is .