#include <bits/stdc++.h>
using namespace std;
bool checkexam(vector<int> a, vector<int> b) {
  for (int i = 0; i < b.size(); i++) {
    bool in = false;
    for (int j = 0; j < a.size(); j++) {
      if (a[j] == b[i]) {
        in = true;
      }
    }
    if (!in) {
      return false;
    }
  }
  return true;
}
int main() {
  int n, m;
  vector<int> g[111];
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> m;
    for (int j = 1; j <= m; j++) {
      int h;
      cin >> h;
      g[i].push_back(h);
    }
  }
  for (int i = 1; i <= n; i++) {
    int t = 0;
    for (int j = 1; j <= n; j++) {
      if (i == j) continue;
      if (g[i].size() >= g[j].size()) {
        bool y = checkexam(g[i], g[j]);
        if (y) t++;
      }
    }
    if (t > 0) {
      cout << "NO" << endl;
    } else
      cout << "YES" << endl;
  }
  return 0;
}
