Knapsack in a Globalized World
Globalization stops at nothing, not even at the good old honest profession of a burglar. Nowadays it is not enough to break in somewhere, take everything you can carry and dart off. No! You have to be competitive, optimise your profit and utilise synergies.
So, the new game rules are:
break only into huge stores, so there is practically endless supply of any kind of items;
your knapsack should be huge;
your knapsack should be full (there should be no empty space left).
Damn you, globalisation, these rules are not easy to follow! Luckily, you can write a program, which will help you decide whether you should loot a store or not.
Input
The first line contains two integers and , where is the number of different item types and is the size of your knapsack.
The second line contains integers for all ), where are the sizes of the item types.
Output
Output "possible" if it is possible to fill your knapsack with items from the store (you may assume that there are enough items of any type), otherwise output "impossible".