Packing

No attempts yetTime limit1sMemory limit256 MB

Problem

Camping season is here. A trip needs all sorts of gear, and you carry that gear yourself, so deciding what you really need matters. The gear is already picked out, so the only thing left is to pack it into backpacks.

One backpack takes any number of items, as long as their total weight does not exceed its capacity. Items cannot be split, so part of the capacity you buy may go unused.

The catch is that you own no backpacks yet and have to buy them. The shop sells backpacks of several capacities, and they all cost the same. Buy enough backpacks to hold every item while spending as little as possible.

Input

The first line contains the number of items to pack, nn, and the number of backpacks in the shop, mm. (1n241 \le n \le 24, 1m1001 \le m \le 100)

The second line contains nn integers a1,a2,,ana_1, a_2, \dots, a_n. The value aia_i is the weight of the ii-th item. (1ai1081 \le a_i \le 10^8)

The third line contains mm integers c1,c2,,cmc_1, c_2, \dots, c_m. The value cic_i is the capacity of the ii-th backpack. (1ci1081 \le c_i \le 10^8)

Output

Print on the first line the minimum number of backpacks that hold every item. If packing every item is impossible, print the word NIE instead.

Hint

In the first example you can buy the first backpack and the third backpack. The heaviest item goes into the backpack of capacity 11, and the remaining items go into the backpack of capacity 9.