#include <bits/stdc++.h>
using namespace std;
int n, i, m, x, q, p, s, j;
vector<int> A[100001];
int main() {
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> m;
    for (j = 0; j < m; j++) {
      cin >> x;
      A[i].push_back(x);
    }
  }
  for (i = 0; i < n; i++) {
    string st = "YES";
    for (j = 0; j < n; j++) {
      if (i == j) continue;
      s = 0;
      for (p = 0; p < A[i].size(); p++) {
        for (q = 0; q < A[j].size(); q++) {
          if (A[i][p] == A[j][q]) {
            s++;
          }
        }
      }
      if (s == A[j].size()) {
        st = "NO";
      }
    }
    cout << st << endl;
  }
}
