#include <bits/stdc++.h>
using namespace std;
int n, m[111], temp[111][111];
bool arr[111][111];
int counts[111];
bool win;
int main() {
  memset(arr, 0, sizeof arr);
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &m[i]);
    for (int j = 0; j < m[i]; j++) {
      scanf("%d", &temp[i][j]);
      arr[i][temp[i][j]] = true;
    }
  }
  for (int i = 0; i < n; i++) {
    win = true;
    for (int j = 0; j < n; j++) {
      counts[j] = m[j];
    }
    for (int j = 0; j < m[i]; j++) {
      if (!win) break;
      for (int k = 0; k < n; k++) {
        if (k != i) {
          if (arr[k][temp[i][j]]) {
            counts[k]--;
            if (counts[k] == 0) {
              win = false;
              break;
            }
          }
        }
      }
    }
    if (win)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
