#include <bits/stdc++.h>
using namespace std;
ifstream in("input.txt");
ofstream out("output.txt");
int main() {
  int mas1[105];
  int mas2[105][105];
  int n;
  scanf("%i", &n);
  for (int i = 0; i < n; i++) {
    scanf("%i", &mas1[i]);
    for (int j = 0; j < mas1[i]; j++) {
      scanf("%i", &mas2[i][j]);
    }
  }
  for (int i = 0; i < n; i++) {
    int mas3[105];
    for (int j = 0; j < n; j++) {
      mas3[j] = mas1[j];
    }
    bool wellnull = false;
    for (int j = 0; j < mas1[i]; j++) {
      bool hasnull = false;
      int num = mas2[i][j];
      for (int t = 0; t < n; t++) {
        if (t != i) {
          for (int r = 0; r < mas1[t]; r++) {
            if (num == mas2[t][r]) {
              mas3[t]--;
              if (mas3[t] == 0) hasnull = true;
            }
          }
        }
      }
      if (hasnull) {
        wellnull = true;
        printf("NO\n");
        j = 100000;
      }
    }
    if (wellnull == false) {
      printf("YES\n");
    }
  }
  return 0;
}
