#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, c;
  cin >> n;
  vector<vector<bool> > arr(n, vector<bool>(101));
  for (int i = 0; i < n; i++) {
    cin >> k;
    for (int j = 0; j < k; j++) {
      cin >> c;
      arr[i][c] = true;
    }
  }
  for (int i = 0; i < n; i++) {
    bool check = true;
    for (int j = 0; j < n; j++) {
      if (i != j) {
        int q = 1;
        for (q; q < 101; q++) {
          if (arr[j][q] && !(arr[i][q])) break;
        }
        if (q == 101) {
          check = false;
          break;
        } else
          check = true;
      }
    }
    if (check)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
