Virus

No attempts yetTime limit1sMemory limit128 MB

Problem

A new computer virus has been discovered, and you want to build a vaccine program to remove it. To build the vaccine you must know the virus code: the part that appears in common across all infected programs is suspected to be the virus. Each program's code is represented as a sequence of positive integers.

To avoid detection, the virus may insert its code in reverse. Therefore a code and its reversal are treated as the same virus code — for example, one program may contain it as A B C D while another contains it as D C B A.

Because parts of two programs' codes may match by coincidence, a common code is only suspected to be the virus when its length is at least KK.

Given NN infected programs, write a program that decides whether there exists a contiguous code fragment of length at least KK that appears (forward or reversed) in every one of the programs.

Input

The first line contains the number of infected programs NN and the minimum length KK required to suspect a virus code. (2N1002 \le N \le 100, 4K1,0004 \le K \le 1{,}000)

From the second line, the information for each program is given in order. For each program, its code length MiM_i is given on one line, and the next line contains the MiM_i positive integers that make up the program's code, separated by spaces. (10Mi1,00010 \le M_i \le 1{,}000, and each integer is between 11 and 10,00010{,}000 inclusive.)

Output

Print YES if a suspected virus code exists in all programs, and NO otherwise.