#include <bits/stdc++.h>
using namespace std;
const int MXN = 1e2 + 10;
vector<int> v[MXN];
int n, m, x;
int a[MXN], b[MXN];
bool u[MXN][MXN];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> m;
    for (int k = 1; k <= m; k++) {
      cin >> x;
      v[i].push_back(x);
      a[i]++;
      b[i]++;
      u[i][x] = true;
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int k = 0; k < v[i].size(); k++) {
      for (int q = 1; q <= n; q++)
        if (u[q][v[i][k]]) a[q]--;
    }
    int num = 0;
    for (int k = 1; k <= n; k++)
      if (a[k] == 0) num++;
    if (num == 1)
      cout << "YES\n";
    else
      cout << "NO\n";
    for (int k = 1; k <= n; k++) a[k] = b[k];
  }
  return 0;
}
