#include <bits/stdc++.h>
using namespace std;
int a[105][105], N, m[105];
bool f[105];
int main() {
  scanf("%d", &N);
  for (int i = 1; i <= N; ++i) {
    scanf("%d", &m[i]);
    for (int j = 1; j <= m[i]; ++j) scanf("%d", &a[i][j]);
  }
  for (int i = 1; i <= N; ++i) {
    memset(f, 0, sizeof(f));
    for (int j = 1; j <= m[i]; ++j) f[a[i][j]] = true;
    bool flag = true;
    for (int j = 1; j <= N; ++j) {
      if (j == i) continue;
      bool ff = true;
      for (int k = 1; k <= m[j]; ++k)
        if (!f[a[j][k]]) ff = false;
      if (ff) flag = false;
    }
    if (flag)
      puts("YES");
    else
      puts("NO");
  }
}
