#include <bits/stdc++.h>
using namespace std;
unordered_set<int> data[109];
int func(int a, int b) {
  if (data[a].size() < data[b].size()) return 1;
  int state = 0;
  for (unordered_set<int>::iterator it = data[b].begin(); it != data[b].end();
       ++it) {
    if (data[a].find(*it) == data[a].end()) {
      state = 1;
      break;
    }
  }
  if (state == 1)
    return 1;
  else
    return 0;
}
int main(void) {
  int i, n, tt, j;
  int tmp;
  while (scanf("%d", &n) == 1) {
    for (i = 1; i <= n; ++i) data[i].clear();
    for (i = 1; i <= n; ++i) {
      scanf("%d", &tt);
      for (j = 1; j <= tt; ++j) {
        scanf("%d", &tmp);
        data[i].insert(tmp);
      }
    }
    for (i = 1; i <= n; ++i) {
      int state = 0;
      for (j = 1; j <= n; ++j) {
        if (i != j && func(i, j) == 0) {
          state = 1;
          break;
        }
      }
      if (state == 1)
        printf("NO\n");
      else
        printf("YES\n");
    }
  }
  return 0;
}
