#include <bits/stdc++.h>
using namespace std;
const double eps = 1.0e-11;
const double pi = acos(-1.0);
bitset<110> lose;
int main() {
  int n;
  cin >> n;
  vector<bitset<110> > nums(n);
  for (long long i = 0; i < n; i++) {
    int m;
    cin >> m;
    for (long long j = 0; j < m; j++) {
      int x;
      cin >> x;
      nums[i][x] = 1;
    }
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < n; j++) {
      if (i == j) continue;
      bool ok = true;
      for (long long t = 1; t <= 100; t++) {
        if (nums[i][t] && !nums[j][t]) ok = false;
      }
      if (ok) lose[j] = 1;
    }
  }
  for (long long i = 0; i < n; i++) {
    if (lose[i])
      cout << "NO\n";
    else
      cout << "YES\n";
  }
  return 0;
}
