#include <bits/stdc++.h>
using namespace std;
int vis[105];
vector<int> cd[105];
bool ss(vector<int> a, vector<int> b) {
  for (int i = 0; i < b.size(); i++) {
    bool ck = false;
    for (int j = 0; j < a.size(); j++) {
      if (a[j] == b[i]) ck = true;
    }
    if (!ck) return false;
  }
  return true;
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int m;
    cin >> m;
    for (int j = 0; j < m; j++) cd[i].push_back(0);
    for (int j = 0; j < m; j++) {
      cin >> cd[i][j];
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; vis[i] == 0 && j < n; j++) {
      if (i != j) {
        if (ss(cd[i], cd[j])) vis[i] = 1;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    if (vis[i])
      cout << "NO\n";
    else
      cout << "YES\n";
  }
}
