#include <bits/stdc++.h>
using namespace std;
const long double PI = acos(-1.0);
vector<long long> v[104];
bool isSubset(long long j, long long i) {
  for (long long k : v[j]) {
    if (!binary_search(v[i].begin(), v[i].end(), k)) return 0;
  }
  return 1;
}
void solve() {
  long long n;
  cin >> n;
  for (long long i = 0; i < n; ++i) {
    long long cnt;
    cin >> cnt;
    v[i].resize(cnt);
    for (long long j = 0; j < cnt; ++j) {
      cin >> v[i][j];
    }
    sort(v[i].begin(), v[i].end());
  }
  for (long long i = 0; i < n; ++i) {
    long long f = 1;
    for (long long j = 0; j < n; ++j) {
      if (i != j) {
        if (isSubset(j, i)) {
          f = 0;
          break;
        }
      }
    }
    if (f) {
      cout << "YES" << '\n';
    } else
      cout << "NO" << '\n';
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
