#include <bits/stdc++.h>
using namespace std;
int n, m[110], ms[110][110];
bool mk[110];
bool testa(int q) {
  memset(mk, 0, sizeof(mk));
  for (int j = 0; j < m[q]; ++j) mk[ms[q][j]] = 1;
  for (int i = 0; i < n; ++i)
    if (i != q) {
      bool ok = 1;
      for (int j = 0; j < m[i]; ++j) ok &= mk[ms[i][j]];
      if (ok) return 0;
    }
  return 1;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &m[i]);
    for (int j = 0; j < m[i]; ++j) scanf("%d", &ms[i][j]);
  }
  for (int i = 0; i < n; ++i) puts(testa(i) ? "YES" : "NO");
  return 0;
}
