#include <bits/stdc++.h>
using namespace std;
const int Maxn = 1e5 + 10;
const int Inf = 0x7f7f7f7f;
const long long Inf_ll = 1ll * Inf * Inf;
const int Mod = 1e9 + 7;
const double eps = 1e-7;
int a[110][110];
bool vis[110][110];
bool check(int x, int y) {
  bool flag = false;
  for (int i = 1; i <= a[y][0]; i++)
    if (vis[x][a[y][i]] == false) {
      flag = true;
      break;
    }
  return flag;
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i][0]);
    for (int j = 1; j <= a[i][0]; j++)
      scanf("%d", &a[i][j]), vis[i][a[i][j]] = true;
    sort(a[i] + 1, a[i] + 1 + a[i][0]);
  }
  for (int i = 1; i <= n; i++) {
    bool flag = true;
    for (int j = 1; j <= n; j++) {
      if (i == j) continue;
      if (!check(i, j)) {
        flag = false;
        break;
      }
    }
    if (flag)
      puts("YES");
    else
      puts("NO");
  }
  return 0;
}
