#include <bits/stdc++.h>
int main() {
  int n, m, i, j, k, num, ans = 1;
  scanf("%d", &n);
  int arr[n][101];
  for (j = 0; j < n; j++)
    for (k = 0; k < 101; k++) arr[j][k] = 0;
  for (i = 0; i < n; i++) {
    scanf("%d", &arr[i][0]);
    for (j = 0; j < arr[i][0]; j++) {
      scanf("%d", &num);
      arr[i][num] = 1;
    }
  }
  for (i = 0; i < n; i++) {
    ans = 1;
    for (j = 0; j < n; j++) {
      if (j != i) {
        for (k = 1; k < 101; k++) {
          if (arr[j][k] != 0) {
            if (arr[j][k] != arr[i][k]) break;
          }
        }
        if (k == 101) {
          ans = 0;
          break;
        }
      }
    }
    if (ans == 1)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
