#include <bits/stdc++.h>
using namespace std;
const int N = 1010;
vector<int> adj[N];
int n;
bool judge(int id) {
  for (int i = 0; i < n; ++i) {
    if (i == id || adj[i].size() > adj[id].size()) continue;
    bool flag = true;
    for (size_t k = 0; k < adj[i].size(); ++k)
      if (!binary_search(adj[id].begin(), adj[id].end(), adj[i][k])) {
        flag = false;
        break;
      }
    if (flag) return false;
  }
  return true;
}
int main() {
  while (cin >> n) {
    int s, a;
    for (int i = 0; i < n; ++i) {
      scanf("%d", &s);
      adj[i].clear();
      while (s--) {
        scanf("%d", &a);
        adj[i].push_back(a);
      }
      sort(adj[i].begin(), adj[i].end());
    }
    for (int i = 0; i < n; ++i) {
      puts(judge(i) ? "YES" : "NO");
    }
  }
}
