Mom asked Lena to clean her room before she plays her favorite online game. Lena almost succeeded: she made the bed, put her clothes into the wardrobe and even threw out all the litter. The last chore remaining is to put all the boxes with action figures onto the shelves.
Lena has n boxes, numbered from 1 to n. Box number i contains k_{i} action figures, each of its own size a_{ij}. Lena wants to finish quickly, but it’s very important to put all the figures in a nondecreasing order by their size. If it’s impossible, then the cleaning cannot be finished at all. Lena has quite a lot of boxes, so she isn’t sure if it can be done.
Lena values her boxes with action figures a lot, and she would never open one, because that would require to tear the wrapping. She also enjoys admiring all the figures, and the boxes only have one clear side, so putting a box back to front is out of question.
Help Lena to see if she could tell mom that cleaning cannon be finished, or if it’s possible and she has to arrange the boxes on the shelf anyway.
Input
The first line contains one integer n — the amount of boxes with action figures (1 ≤ n ≤ 100).
Each of next n lines contains a integer k_{i} — amount of figures in ith box (1 ≤ k_{i} ≤ 100), followed by k_{i} integers a_{ij} — sizes of action figures in order from left to right (1 ≤ a_{ij} ≤ 10^{4}). Integers in one line are separated with spaces.
Output
Print “YES
” (without quotes), if boxes can be arranged in such a way that action figues would be in a nondecreasing order by their size. Otherwise, print “NO
” (without quotes).
Samples
input  output 

3
2 1 2
3 7 7 7
1 5
 YES

2
2 1 3
1 2
 NO

Notes
In the first example, the first box goes first, then the third box, then the second box. That puts figures in a nondecreasing order by their size: 1, 2, 5, 7, 7, 7.
In the second example, there is no arrangement that puts figures in a nondecreasing order.
Problem Author: Ivan Smirnov
Problem Source: Ural School Programming Contest 2019