#include <bits/stdc++.h>
using namespace std;
int n;
vector<vector<int> > card;
vector<vector<int> > bl;
vector<int> hav;
int calc(vector<int> &ball, vector<int> hav) {
  int win = -1;
  for (int i = 0; i < ball.size(); ++i) {
    for (int j = 0; j < bl[ball[i]].size(); ++j)
      if (--hav[bl[ball[i]][j]] == 0) {
        if (win != -1) return -1;
        win = bl[ball[i]][j];
      }
  }
  return win;
}
int main() {
  cin >> n;
  card.resize(n);
  bl.resize(101);
  for (int i = 0, x; i < n; ++i) {
    cin >> x;
    card[i].resize(x);
    hav.push_back(x);
    for (int j = 0; j < x; ++j) {
      cin >> card[i][j];
      bl[card[i][j]].push_back(i);
    }
  }
  for (int i = 0; i < n; ++i)
    if (calc(card[i], hav) == i)
      puts("YES");
    else
      puts("NO");
  return 0;
}
