#d2615. 抢夺西瓜
抢夺西瓜
Watermelon Snatch
Problem Description
There are players. The -th player holds a card with integers written on it, namely .
The host draws balls from a bag one by one and announces their numbers, then takes the ball away. The bag contains balls numbered to , 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 , the number of players.
The next lines: the -th line begins with an integer , the number of integers on the -th player's card, followed by integers, those numbers.
Output Format
Output lines: the -th line is YES or NO, indicating whether the -th player can win.
Sample Input
3
1 1
3 2 4 1
2 10 11
Sample Output
YES
NO
YES