#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> value[105], my[105];
  int tam[105], n, num, qnt[105] = {}, v;
  bool fg;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &tam[i]);
    for (int j = 0; j < tam[i]; j++) {
      scanf("%d", &num);
      value[num].push_back(i);
      my[i].push_back(num);
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < tam[i]; j++) {
      num = my[i][j];
      for (int k = 0; k < value[num].size(); k++) {
        v = value[num][k];
        qnt[v]++;
      }
    }
    fg = false;
    for (int j = 1; j <= n; j++)
      if (j != i && qnt[j] == tam[j]) fg = true;
    if (fg)
      printf("NO\n");
    else
      printf("YES\n");
    for (int j = 0; j <= n; j++) qnt[j] = 0;
  }
  return 0;
}
