UJGOI in Cracow#406

UJGOI in Cracow

1 second
256 megabytes
Very hard (≈2050)

You have reached the finals of UJGOI! Each of the participants (ranked 1, 2, \dots, n) must be assigned to one of available classrooms. Although some participants have already been assigned a classroom, you must assign classrooms for the remaining students.

However, to avoid grouping too many similarly ranked participants together, your final arrangement a_1, a_2, \dots, a_n (where 1\le a_i\le k is the classroom of the -th participant) must satisfy the following condition:

For every contiguous segment (with 1 \le \ell < r \le n), there should be no classroom that appears strictly more than \frac{r-\ell+1}{2} times — that is, there is no classroom that the majority of the students are put in.

Your task is to determine an assignment that meets these criteria.

Input

The first line contains one integer (1\le n\le 2\cdot 10^5) — the number of participants.

The second line contains one integer (1\le k\le 10^6) — the number of available classrooms.

The third line contains integers a_1,~a_2,\dots,~a_n (0\le a_i\le k) — the arrangement of the participants where a_i=0 means that its value is not determined yet.

Output

In the first line, output "YES" if there is an arrangement that satisfies the statement and "NO" otherwise.

If there is such an arrangement, then output modified a_1,\dots, a_n in the second line.

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading

Note

In the first example, one of the possible configurations is a=[1, 2, \underline{4}, \underline{3}, 1]. For example, if \ell=1 and r=3, then [a_1, a_2, a_3]=a[1..3]=[1,2,4] satisfies the condition, since each element occurs only once, while \frac{r-\ell+1}{2}=\frac{3-1+1}{2}=1.5 > 1. You can verify that the condition is met for all 1\le \ell < r\le n.

In the second sample, we can prove that there is no configuration satisfying the condition. For example, if the configuration is a=[1, 2, \underline{3}, \underline{2}, 1], then a[2..4]=[2, 3, 2] does not satisfy the condition. Two participants are in one classroom, but \frac{r-\ell+1}{2}=1.5<2.

Scoring

  1. ( points): a_i \geq 1;

  2. ( points): a_i = 0;

  3. ( points): there is no i>1 such that a_i = a_{i-1} = 0;

  4. ( points): k > 5;

  5. ( points): k \le 5;

  6. ( points): without additional constraints.