Vanya and Jackets
문제
Vanya attempted to change his life once again and decided to create a schedule of jackets he is going to wear during the next days.
He read several manuals on jackets operation and found out that different jackets are designed for different temperature ranges. For each of his jackets he determined values of and , the minimum and maximum temperature value that admits wearing the -th jacket.
Vanya knows the weather forecast for the next days, namely there will be the temperature of during the -th day. Since Vanya is sane enough, he will choose the appropriate jacket for each temperature, that is, on the -th day he will wear any jacket such that . Also, Vanya tries to be really fashionable, so he never wears the same jacket for two consecutive days.
Given the fact that Vanya's mother does not allow him leaving home without the jacket or wearing several jackets, create a schedule of which jackets he should wear during the next days satisfying all the requirements of Vanya.
입력
The first line of the input contains two integers and (), the number of days and the number of jackets in Vanya's wardrobe respectively.
The second line of the input contains integers (), the temperature at the -th day.
Then lines follow, -th of them contains two integers and (), defining the temperature range of the -th jacket.
출력
If there exists a way of choosing a jacket for each of the days, output the word "Yes" (without the quotes) in the first line, and numbers in the second line, where is the index of a jacket Vanya should wear in the -th day. Otherwise output the only line containing the word "No" (without the quotes). Jackets are indexed starting from one in the order they appear in the input.
If there are several satisfying schedules, you are allowed to output any of them.
힌트
In the first sample the answer "2 1 2 4" is not the only possible, another correct answer is "1 2 1 4".
In the second sample there is no schedule satisfying the requirements of Vanya, since he is obligated to wear the first jackets for both the first and the second days.
예제
예제 1
4 4 25 25 30 50 10 40 20 30 70 100 50 50
Yes 2 1 2 4
예제 2
4 2 30 40 50 60 30 40 50 60
No