#include <bits/stdc++.h>
using namespace std;
int N;
int A[110][110];
void citire(void) {
  int M, a;
  cin >> N;
  for (int i = 1; i <= N; i++) {
    cin >> M;
    for (int j = 1; j <= M; j++) {
      cin >> a;
      A[i][a] = 1;
    }
  }
}
inline bool subSet(int x, int val) {
  for (int i = 1; i <= 100; i++)
    if (A[x][i] == 1 && A[val][i] == 0) return false;
  return true;
}
inline bool canWin(int val) {
  for (int i = 1; i <= N; i++)
    if (i != val && subSet(i, val)) return false;
  return true;
}
void Rezolvare(void) {
  for (int i = 1; i <= N; i++)
    if (canWin(i))
      cout << "YES\n";
    else
      cout << "NO\n";
}
int main() {
  citire();
  Rezolvare();
}
