#include <bits/stdc++.h>
int main() {
  int a[110][110];
  int cnt[110], x, n;
  while (~scanf("%d", &n)) {
    memset(a, 0, sizeof(a));
    for (int i = 0; i < n; i++) {
      scanf("%d", &cnt[i]);
      for (int j = 0; j < cnt[i]; j++) {
        scanf("%d", &x);
        a[i][x]++;
      }
    }
    for (int i = 0; i < n; i++) {
      int flag = 1;
      for (int j = 0; j < n && flag; j++) {
        if (i == j) continue;
        flag = 0;
        for (int k = 1; k <= 100 && !flag; k++) {
          if (a[j][k] && !a[i][k]) flag = 1;
        }
      }
      if (flag)
        printf("YES\n");
      else
        printf("NO\n");
    }
  }
  return 0;
}
