#include <bits/stdc++.h>
using namespace std;
int n, kol[200], x, k, mett;
bool met[200][200];
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> kol[i];
    for (int j = 1; j <= kol[i]; ++j) {
      cin >> x;
      met[i][x] = true;
    }
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      k = 0;
      mett = 0;
      if (i == j) continue;
      for (int jj = 1; jj <= 100; ++jj) {
        if (met[i][jj] && met[j][jj]) ++k;
      }
      if (k == kol[j]) {
        cout << "NO" << endl;
        mett = 1;
        break;
      }
    }
    if (!mett) cout << "YES" << endl;
  }
  return 0;
}
