#include <bits/stdc++.h>
using namespace std;
bool contains(vector<int>& a, vector<int>& b) {
  if (a.size() < b.size()) return false;
  int posA = 0;
  for (int i = 0; i < b.size(); i++) {
    while (posA < a.size() && a[posA] < b[i]) posA++;
    if (posA == a.size()) return false;
    if (a[posA] > b[i]) return false;
    posA++;
  }
  return true;
}
int main() {
  int n;
  while (cin >> n) {
    vector<vector<int> > players;
    for (int i = 0; i < n; i++) {
      int m;
      cin >> m;
      vector<int> card(m);
      for (int j = 0; j < m; j++) {
        cin >> card[j];
      }
      sort(card.begin(), card.end());
      players.push_back(card);
    }
    for (int i = 0; i < n; i++) {
      int j;
      for (j = 0; j < n; j++) {
        if (j == i) continue;
        if (contains(players[i], players[j])) {
          break;
        }
      }
      if (j < n) {
        cout << "NO" << endl;
      } else {
        cout << "YES" << endl;
      }
    }
  }
}
