#include <bits/stdc++.h>
using namespace std;
struct _ {
  ios_base::Init i;
  _() {
    cin.sync_with_stdio(0);
    cin.tie(0);
  }
} _;
char v[100][100], m[100], s[101][100], l[101], ans[100], t[100], t2[100], tt;
int main() {
  int n, mm, a, i, j;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> mm;
    m[i] = mm;
    for (j = 0; j < mm; j++) {
      cin >> a;
      v[i][j] = a;
      s[a][l[a]++] = i;
    }
  }
  for (i = 0; i < n; i++) {
    mm = m[i];
    a = v[i][0];
    tt = l[a];
    memcpy(t, s[a], tt);
    for (j = 1; j < mm && tt > 1; j++) {
      a = v[i][j];
      tt = set_intersection(t, t + tt, s[a], s[a] + l[a], t2) - t2;
      memcpy(t, t2, tt);
    }
    for (j = 0; j < tt; j++) {
      if (t[j] != i) {
        ans[t[j]] = 1;
      }
    }
  }
  for (i = 0; i < n; i++) {
    cout << (ans[i] ? "NO" : "YES") << '\n';
  }
}
