#include <bits/stdc++.h>
int a[105][105], flag[105];
int cmp(const void *a, const void *b) {
  return ((int *)a)[0] > ((int *)b)[0] ? 1 : -1;
}
int cmp1(const void *a, const void *b) {
  return ((int *)a)[1] > ((int *)b)[1] ? 1 : -1;
}
int main() {
  int n, m, i, j, k, flag4;
  while (scanf("%d", &n) != EOF) {
    for (i = 0; i < n; i++) {
      scanf("%d", &m);
      a[i][0] = m;
      a[i][1] = i;
      for (j = 2; j <= m + 1; j++) {
        scanf("%d", &a[i][j]);
      }
    }
    qsort(a, n, sizeof(int) * 105, cmp);
    a[0][a[0][0] + 2] = 1;
    for (i = 1; i < n; i++) {
      for (j = 0; j < i; j++) {
        memset(flag, 0, sizeof(flag));
        flag4 = 0;
        for (k = 2; k <= a[i][0] + 1; k++) {
          flag[a[i][k]] = 1;
        }
        for (k = 2; k <= a[j][0] + 1; k++) {
          if (flag[a[j][k]]) {
            flag4++;
          }
        }
        if (flag4 == a[j][0]) {
          if (a[i][0] == a[j][0]) {
            a[i][a[i][0] + 2] = 0;
            a[j][a[j][0] + 2] = 0;
          } else
            a[i][a[i][0] + 2] = 0;
          break;
        } else {
          a[i][a[i][0] + 2] = 1;
        }
      }
    }
    qsort(a, n, sizeof(int) * 105, cmp1);
    for (i = 0; i < n; i++) {
      if (a[i][a[i][0] + 2] == 1)
        printf("YES\n");
      else
        printf("NO\n");
    }
  }
  return 0;
}
