#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  vector<vector<int> > a(n);
  for (int i = 0; i < n; ++i) {
    int m;
    cin >> m;
    for (int j = 0; j < m; ++j) {
      int x;
      cin >> x;
      --x;
      a[i].push_back(x);
    }
  }
  for (int i = 0; i < n; ++i) {
    vector<bool> jest1(100, false);
    for (int j = 0; j < a[i].size(); ++j) jest1[a[i][j]] = true;
    bool jest_podz = false;
    for (int j = 0; j < n; ++j) {
      if (j != i) {
        vector<bool> jest2(100, false);
        for (int k = 0; k < a[j].size(); ++k) jest2[a[j][k]] = true;
        bool podz = true;
        for (int k = 0; k < 100; ++k)
          if (jest2[k] && !jest1[k]) podz = false;
        if (podz) jest_podz = true;
      }
    }
    if (jest_podz)
      cout << "NO" << endl;
    else
      cout << "YES" << endl;
  }
  return 0;
}
