#include <bits/stdc++.h>
int n, a[1000][1000];
int main() {
  for (int i = 1; i <= 100; i++)
    for (int j = 1; j <= 100; j++) a[i][j] = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    int t, v;
    scanf("%d", &t);
    for (int j = 1; j <= t; j++) {
      scanf("%d", &v);
      a[i][v] = 1;
    }
  }
  bool f1;
  for (int i = 1; i <= n; i++) {
    f1 = true;
    bool f;
    for (int j = 1; j <= n; j++)
      if (i != j) {
        f = false;
        for (int k = 1; k <= 100; k++)
          if (a[j][k] == 1 && a[i][k] == 0) {
            f = true;
            break;
          }
        if (f == false) {
          f1 = false;
          break;
        }
      }
    if (f1 == true)
      printf("YES");
    else
      printf("NO");
    printf("\n");
  }
  return 0;
}
