Library game

아직 제출이 없습니다시간 제한2초메모리 제한1024 MB

문제

Alessia and Bernardo are discovering the world of competitive programming through the books of their university library.

The library consists of mm sections numbered from 11 to mm. Each section contains only books dedicated to a particular subject and different sections correspond to different subjects. In order to prevent the students from wandering in the library, the university has established a system of passes. Each pass has a length yy associated to it and allows access to an interval of yy consecutive sections in the library. During a visit, the student must choose exactly one book from one of these sections and leave the library. Each pass can be used only once.

At the moment Alessia and Bernardo have nn passes of lengths x_1,x_2,,x_nx\_1, x\_2, \dots , x\_n. They have different opinions on the best way to improve: Alessia thinks that it is important to study many different topics, while Bernardo believes that it is important to study deeply at least one topic. So, Alessia wants to use the nn passes to get nn books on distinct topics, while Bernardo would like to get at least two books on the same topic.

They have reached the following agreement: for each of the following nn days, Alessia will choose a pass of length yy among those which are still available and an interval of yy sections in the library, and Bernardo will go into the library and will take exactly one book from one of those sections.

Can Bernardo manage to get at least two books on the same subject, or will Alessia be able to avoid it?

You should decide whether you want to be Alessia or Bernardo, and you have to fulfill the goal of your chosen character. The judge will impersonate the other character. Note that, even if at some moment Bernardo has already taken two books on the same subject, the interaction should go on until the end of the nn days.

입력

The first line contains two integers nn and mm (1n1001 ≤ n ≤ 100, nm5000n ≤ m ≤ 5000) — the number of passes and the number of sections.

The second line contains nn integers x_1,x_2,,x_nx\_1, x\_2, \dots , x\_n (1x_im1 ≤ x\_i ≤ m) — the lengths of the passes available.