#include <bits/stdc++.h>
int cards[105][105];
int main() {
  int n;
  while (EOF != scanf("%d", &n)) {
    memset(cards, 0, sizeof(cards));
    for (int i = 0; i < n; ++i) {
      scanf("%d", &cards[i][0]);
      int tmp;
      for (int j = 1; j <= cards[i][0]; ++j) {
        scanf("%d", &tmp);
        cards[i][tmp] = 1;
      }
    }
    for (int i = 0; i < n; ++i) {
      int ok = 1;
      for (int j = 0; j < n; ++j) {
        if (i == j) {
          continue;
        }
        int cnt = 0;
        for (int k = 1; k <= 100; ++k) {
          if (cards[i][k] == 1 && cards[j][k] == 1) {
            ++cnt;
          }
        }
        if (cnt == cards[j][0]) {
          ok = 0;
          break;
        }
      }
      printf("%s\n", (ok == 1) ? "YES" : "NO");
    }
  }
  return 0;
}
