#include <bits/stdc++.h>
using namespace std;
bool M[105][105];
bool A[105];
vector<pair<int, int> > V;
int N;
int main() {
  scanf("%d", &N);
  for (int i = 1; i <= N; i++) {
    int u;
    scanf("%d", &u);
    V.push_back(make_pair(u, i));
    for (int j = 0; j < u; j++) {
      int v;
      scanf("%d", &v);
      M[i][v] = 1;
    }
  }
  sort(V.begin(), V.end());
  for (int i = 0; i < N; i++)
    for (int j = i + 1; j < N; j++) {
      bool f = 1;
      bool p = 1;
      int u = V[i].second, v = V[j].second;
      for (int k = 1; k <= 100; k++) {
        if (M[u][k] && !M[v][k]) f = 0;
        if (M[u][k] != M[v][k]) p = 0;
      }
      if (f) A[v] = 1;
      if (p) A[u] = 1;
    }
  for (int i = 1; i <= N; i++)
    if (A[i])
      printf("NO\n");
    else
      printf("YES\n");
}
