#include <bits/stdc++.h>
using namespace std;
bool is_subset(const set<int> &A, const set<int> &B) {
  for (set<int>::iterator it = A.begin(); it != A.end(); it++) {
    if (B.find(*it) == B.end()) return false;
  }
  return true;
}
const int MAXN = 105;
set<int> S[MAXN];
int n;
int main() {
  cin >> n;
  int m, temp;
  for (int i = 0; i < n; i++) {
    cin >> m;
    for (int j = 0; j < m; j++) {
      cin >> temp;
      S[i].insert(temp);
    }
  }
  for (int i = 0; i < n; i++) {
    bool yes = true;
    for (int j = 0; j < n; j++) {
      if (i != j) {
        if (is_subset(S[j], S[i])) {
          yes = false;
          break;
        }
      }
    }
    if (yes)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
