#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:64000000")
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<vector<int> > v(n);
  for (int i = 0; i < n; i++) {
    int m;
    cin >> m;
    v[i].resize(m);
    for (int j = 0; j < m; j++) {
      cin >> v[i][j];
    }
    sort(v[i].begin(), v[i].end());
  }
  for (int i = 0; i < n; i++) {
    bool yes = true;
    for (int j = 0; j < n; j++)
      if (i != j) {
        bool ok = true;
        for (int k = 0; k < v[j].size(); k++) {
          if (!binary_search(v[i].begin(), v[i].end(), v[j][k])) {
            ok = false;
            break;
          }
        }
        if (ok) {
          yes = false;
          break;
        }
      }
    puts(yes ? "YES" : "NO");
  }
  return 0;
}
