#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  scanf("%d", &n);
  vector<vector<int> > p(n);
  for (int i = 0; i < n; i++) {
    int sz;
    scanf("%d", &sz);
    p[i].resize(sz);
    for (int j = 0; j < sz; j++) scanf("%d", &p[i][j]);
  }
  for (int i = 0; i < n; i++) {
    bool can = true;
    for (int j = 0; j < n; j++) {
      if (i == j || p[j].size() > p[i].size()) continue;
      int has[101] = {0};
      bool ok = true;
      for (int k = 0; k < p[j].size(); k++) has[p[j][k]]++;
      for (int k = 0; k < p[i].size(); k++) has[p[i][k]]++;
      for (int k = 0; k < p[j].size(); k++)
        if (has[p[j][k]] != 2) ok = false;
      can &= !(ok);
    }
    if (can)
      puts("YES");
    else
      puts("NO");
  }
  return 0;
}
