#include <bits/stdc++.h>
using namespace std;
const int N = 111;
char buff[N];
int n;
vector<vector<int> > v;
bool includes(vector<int> v1, vector<int> v2) {
  for (int i = 0; i < v2.size(); i++)
    if (find(v1.begin(), v1.end(), v2[i]) == v1.end()) return false;
  return true;
}
bool canWin(int ind) {
  for (int i = 0; i < v.size(); i++) {
    if (i != ind && includes(v[ind], v[i])) return false;
  }
  return true;
}
int main() {
  scanf("%d", &n);
  v.resize(n);
  for (int i = 0; i < n; i++) {
    int l = 0;
    scanf("%d", &l);
    v[i].resize(l);
    for (int j = 0; j < l; j++) scanf("%d", &v[i][j]);
    sort(v[i].begin(), v[i].end());
  }
  for (int i = 0; i < n; i++) {
    if (canWin(i))
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
