#include <bits/stdc++.h>
using namespace std;
int n, m, tmp;
long long bingo[105][2];
long long cm[70];
bool ans[105];
long long tmp1, tmp2;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  cm[1] = 1;
  for (int i = 2; i <= 63; i++) {
    cm[i] = cm[i - 1] << 1;
  }
  for (int i = 1; i <= n; i++) {
    cin >> m;
    for (int j = 1; j <= m; j++) {
      cin >> tmp;
      if (tmp <= 63)
        bingo[i][0] += cm[tmp];
      else
        bingo[i][1] += cm[tmp - 63];
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      tmp1 = bingo[i][0] | bingo[j][0];
      tmp2 = bingo[i][1] | bingo[j][1];
      if (tmp1 == bingo[i][0] && tmp2 == bingo[i][1]) ans[i] = true;
      if (tmp1 == bingo[j][0] && tmp2 == bingo[j][1]) ans[j] = true;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (ans[i])
      cout << "NO\n";
    else
      cout << "YES\n";
  }
  return 0;
}
