Division of Property#8772

Division of Property

1 second
64 megabytes
Hard

Sema and Yura have baskets of apples, with a total of different types of apples. In the -th basket, there are c_i apples, and the type of the -th apple in the -th basket is denoted as a_{ij}.

They have had a disagreement and wish to divide the baskets such that:

Your task is to help them divide the baskets accordingly.

Input

The first line contains two integers and (2 \leq n \leq 10^5, 1 \leq m \leq 10^5) — representing the number of baskets and the number of apple types, respectively.

The following lines describe the baskets. Each basket's description consists of two lines. The first line contains a single integer c_i (1 \leq c_i \leq 2 \cdot 10^5), indicating the number of apples in the basket. The second line lists c_i integers a_{i1}, a_{i2}, , a_{ic_i} (1 \leq a_{ij} \leq m) — representing the types of apples in that basket.

It is guaranteed that the total sum of all c_i does not exceed 2 \cdot 10^5.

Output

Print «YES» if it is possible to divide the baskets as required, or «NO» if it is not.

If the answer is «YES», also provide a second line with integers, either or . If the -th number is , the -th basket should be assigned to Sema; if , to Yura.

If there are multiple valid solutions, you may print any of them.

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading