#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
bool vis[110][110];
bool per[110];
int pn[110];
int n;
int main() {
  while (~scanf("%d", &n)) {
    memset(vis, false, sizeof(vis));
    for (int h = 1; h <= n; h++) {
      scanf("%d", &pn[h]);
      for (int i = 1; i <= pn[h]; i++) {
        int tmp;
        scanf("%d", &tmp);
        vis[h][tmp] = true;
      }
    }
    memset(per, true, sizeof(per));
    int ct;
    for (int h = 1; h <= n; h++) {
      for (int i = 1; i <= n; i++) {
        if (i == h) continue;
        ct = 0;
        for (int j = 1; j <= 100; j++)
          if (vis[h][j] && vis[i][j]) ct++;
        if (ct == pn[i]) per[h] = false;
      }
    }
    for (int h = 1; h <= n; h++)
      if (per[h])
        puts("YES");
      else
        puts("NO");
  }
  return 0;
}
