#include <bits/stdc++.h>
using namespace std;
int f[105][105], n, m[105], tot, a, ff;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &m[i]);
    for (int j = 1; j <= m[i]; j++) {
      scanf("%d", &a);
      f[i][a] = 1;
    }
  }
  for (int i = 1; i <= n; i++) {
    ff = 0;
    for (int j = 1; j <= n; j++)
      if (i != j) {
        tot = 0;
        for (int k = 0; k <= 100; k++) {
          if (f[i][k] == 1 && f[j][k] == 1) tot++;
        }
        if (tot >= m[j]) {
          printf("NO\n");
          ff = 1;
          break;
        }
      }
    if (ff == 0) printf("YES\n");
  }
  return 0;
}
