#include <bits/stdc++.h>
using namespace std;
vector<int> mat[102];
int vis[102];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int num;
    cin >> num;
    for (int j = 0; j < num; j++) {
      int tmp;
      cin >> tmp;
      mat[i].push_back(tmp);
    }
  }
  for (int i = 0; i < n; i++) {
    bool flag = true;
    memset(vis, 0, sizeof vis);
    for (int j = 0; j < mat[i].size(); j++)
      for (int k = 0; k < n; k++)
        for (int l = 0; l < mat[k].size(); l++) {
          if (mat[i][j] == mat[k][l]) vis[k]++;
          if (k != i && vis[k] == mat[k].size()) flag = false;
        }
    if (flag)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
}
