#d2615. 抢夺西瓜

抢夺西瓜

Watermelon Snatch

Problem Description

There are tt players. The ii-th player holds a card with nin_i integers written on it, namely m1,m2,…,mnim_1, m_2, \dots, m_{n_i}.

The host draws balls from a bag one by one and announces their numbers, then takes the ball away. The bag contains 100100 balls numbered 11 to 100100, all distinct. If a player's card contains the announced number, he may cross it out. The first player to cross out all numbers on his card wins; if multiple players cross out their last number at the same time, then none of them wins.

Given the numbers on each player's card, determine: for each player, whether there exists an order of drawing by the host such that this player wins.

Input Format

The first line contains an integer tt, the number of players.

The next tt lines: the ii-th line begins with an integer nin_i, the number of integers on the ii-th player's card, followed by nin_i integers, those numbers.

Output Format

Output tt lines: the ii-th line is YES or NO, indicating whether the ii-th player can win.

Sample Input

3
1 1
3 2 4 1
2 10 11

Sample Output

YES
NO
YES

Constraints

  • 1≤t≤1001 \le t \le 100
  • 1≤n≤1001 \le n \le 100
  • 1≤mi≤1001 \le m_i \le 100