Conan is a detective in the city of ACM. Not long ago a rare book was stolen from the library of ACM City University. On the day of the theft many students visited the library. Each student entered exactly once, stayed for a single continuous stretch of time, and then left.
We assume that whenever two students were in the library at the same time, at least one of them saw the other. Conan met every student who had been to the library that day and asked each of them whom they saw inside. He now wants to decide whether the testimony he collected could match some real set of visits under this assumption.
For example, suppose four students visited the library and gave this testimony:
This testimony cannot happen. Student 2 and Student 4 did not see each other, so their visits did not overlap and they were in the library at different times. Yet Student 1 saw both of them, so Student 1's visit had to overlap Student 2's visit and Student 4's visit; the same holds for Student 3. That forces Student 1 and Student 3 to have been present at the same moment, so at least one of them should have seen the other. Neither did, which is a contradiction.
For a second example, suppose three students visited and gave this testimony:
This testimony is possible. It happens, for instance, if all three students were in the library at the same time.
Given such a testimony, write a program that decides whether the situation could really have occurred under the assumption above.
The first line contains the number of test cases T. Each test case has the following form.
The first line of a test case contains a single integer n, the number of students, with 1≤n≤200. The next n lines describe the testimony. The i-th of these lines begins with an integer k, the number of students that Student i says he saw, followed by the k ids of those students. If Student i saw no one, the line contains only 0. Students are numbered from 1 to n, and the integers on each line are separated by spaces.
For each test case print exactly one line. Print YES if the testimony could correspond to a real set of visits, and NO otherwise.