#include <bits/stdc++.h>
using namespace std;
const int MAX = 103;
int n, m[MAX][MAX], have[MAX];
int subset(int y) {
  for (int i = 1; i <= m[y][0]; i++)
    if (!have[m[y][i]]) return 0;
  return 1;
}
int main() {
  while (scanf("%d", &n) == 1) {
    for (int i = 0; i < n; i++) {
      scanf("%d", &m[i][0]);
      for (int x = 1; x <= m[i][0]; x++) scanf("%d", &m[i][x]);
    }
    for (int i = 0; i < n; i++) {
      int ans = 1;
      memset(have, 0, sizeof(have));
      for (int j = 1; j <= m[i][0]; j++) have[m[i][j]] = 1;
      for (int j = 0; j < n && ans; j++)
        if (i != j && subset(j)) ans = 0;
      puts(ans ? "YES" : "NO");
    }
  }
  return 0;
}
