#include <bits/stdc++.h>
using namespace std;
vector<int> g[110];
bool res[110];
void comp(int a, int b) {
  int iguais = 0, pa, pb;
  if ((int)g[a].size() > (int)g[b].size()) swap(a, b);
  for (pa = 0, pb = 0; pa < (int)g[a].size() && pb < (int)g[b].size();) {
    if (g[a][pa] == g[b][pb]) {
      iguais++;
      pa++;
      pb++;
    } else if (g[a][pa] > g[b][pb])
      pb++;
    else
      pa++;
  }
  if (iguais == (int)g[a].size()) {
    res[b] = false;
    if (g[a].size() == g[b].size()) res[a] = false;
  }
  return;
}
int main() {
  memset(res, true, sizeof(res));
  int n, x;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &x);
    for (int j = 0; j < x; j++) {
      int k;
      scanf("%d", &k);
      g[i].push_back(k);
    }
  }
  for (int i = 0; i < n; i++) {
    sort(g[i].begin(), g[i].end());
  }
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      comp(i, j);
    }
  }
  for (int i = 0; i < n; i++) {
    if (res[i])
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
