#include <bits/stdc++.h>
using namespace std;
bool isSubsequence(const vector<int> &a, const vector<int> &b) {
  for (int i = 0; i < a.size(); ++i) {
    if (find(b.begin(), b.end(), a[i]) == b.end()) {
      return false;
    }
  }
  return true;
}
int main() {
  int n;
  cin >> n;
  vector<vector<int> > cards(n);
  int m, tmp;
  for (int i = 0; i < n; ++i) {
    cin >> m;
    for (int j = 0; j < m; ++j) {
      cin >> tmp;
      cards[i].push_back(tmp);
    }
  }
  for (int i = 0; i < n; ++i) {
    bool findSubseq = false;
    for (int j = 0; j < n; ++j) {
      if (j != i) {
        if (isSubsequence(cards[j], cards[i])) {
          findSubseq = true;
          cout << "NO" << endl;
          break;
        }
      }
    }
    if (!findSubseq) {
      cout << "YES" << endl;
    }
  }
  return 0;
}
