#include <bits/stdc++.h>
struct P {
  int num, vis[107], id[107];
} p[107];
int main() {
  int n;
  while (scanf("%d", &n) != EOF) {
    memset(p, 0, sizeof(p));
    for (int i = 1; i <= n; i++) {
      scanf("%d", &p[i].num);
      for (int j = 0; j < p[i].num; j++)
        scanf("%d", &p[i].id[j]), p[i].vis[p[i].id[j]] = 1;
    }
    for (int i = 1; i <= n; i++) {
      int flag = 0;
      for (int j = 1; j <= n; j++) {
        if (i == j) continue;
        int sum = 0;
        for (int k = 0; k < p[i].num; k++) {
          if (p[j].vis[p[i].id[k]]) sum++;
        }
        if (sum == p[j].num) {
          flag = 1;
          break;
        }
      }
      if (!flag)
        printf("YES\n");
      else
        printf("NO\n");
    }
  }
  return 0;
}
