#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, x;
  cin >> n;
  map<int, map<int, bool> > vis;
  for (int i = 0; i < n; ++i) {
    cin >> m;
    for (int j = 0; j < m; ++j) cin >> x, vis[i][x] = true;
  }
  for (int i = 0; i < n; ++i) {
    bool win = true;
    for (int j = 0; j < n; ++j) {
      if (i != j) {
        bool lose = true;
        for (int k = 1; k <= 100; ++k) {
          if (!vis[i][k] && vis[j][k]) {
            lose = false;
            break;
          }
        }
        if (lose) {
          win = !lose;
          puts("NO");
          break;
        }
      }
    }
    if (win) {
      puts("YES");
    }
  }
  return 0;
}
