#include <bits/stdc++.h>
using namespace std;
const int n_max = 105;
int n, m[n_max], i, j, f[n_max][n_max], x, cur, t, a, k;
int main() {
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%d", &m[i]);
    for (j = 1; j <= m[i]; j++) {
      scanf("%d", &x);
      f[i][x] = 1;
    }
  }
  for (i = 1; i <= n; i++) {
    t = 1;
    for (j = 1; j <= n; j++)
      if (i != j) {
        a = m[j];
        for (k = 1; k <= 100; k++)
          if (f[i][k] && f[j][k]) a--;
        if (a == 0) {
          t = 0;
          break;
        }
      }
    if (t)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
