#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, t;
  set<int> s[105];
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> m;
    for (int j = 0; j < m; ++j) {
      cin >> t;
      s[i].insert(t);
    }
  }
  vector<int> v(105);
  for (int i = 0; i < n; ++i) {
    bool ok = true;
    for (int j = 0; j < n; ++j) {
      if (i == j) continue;
      vector<int>::iterator it = set_union(s[i].begin(), s[i].end(),
                                           s[j].begin(), s[j].end(), v.begin());
      if ((it - v.begin()) == s[i].size()) {
        ok = false;
        break;
      }
    }
    if (ok)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
