#include <bits/stdc++.h>
using namespace std;
int table[105][105], no[105];
int main() {
  int n, m, i, j, k, a, b, check, c;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%d", &m);
    table[i][0] = m;
    for (j = 0; j < m; j++) {
      scanf("%d", &a);
      table[i][a] = 1;
    }
  }
  for (i = 1; i <= n; i++) {
    c = 0;
    for (j = 1; j <= n; j++) {
      if (i == j) continue;
      check = 0;
      if (table[i][0] < table[j][0])
        check = 1;
      else {
        for (k = 1; k <= 100; k++) {
          if (table[j][k] == 1 && table[i][k] == 0) {
            check = 1;
            break;
          }
        }
      }
      if (check == 0) {
        c = 1;
        break;
      }
    }
    if (c) no[i] = 1;
  }
  for (i = 1; i <= n; i++) {
    if (no[i])
      printf("NO\n");
    else
      printf("YES\n");
  }
  scanf(" ");
  return 0;
}
