#include <bits/stdc++.h>
using namespace std;
const int OO = (int)2e9;
const double eps = 1e-9;
int main() {
  int n, i, j, k, c;
  int m[105], arr[105][105];
  vector<set<int> > V(100);
  cin >> n;
  for ((i) = 0; (i) < (n); (i)++) {
    cin >> m[i];
    for ((j) = 0; (j) < (m[i]); (j)++) {
      cin >> arr[i][j];
      V[i].insert(arr[i][j]);
    }
  }
  for ((i) = 0; (i) < (n); (i)++) {
    for ((j) = 0; (j) < (n); (j)++) {
      c = 0;
      if (i != j && m[i] >= m[j]) {
        for ((k) = 0; (k) < (m[j]); (k)++)
          if (V[i].find(arr[j][k]) != V[i].end()) c++;
      }
      if (c == m[j]) goto end;
    }
    puts("YES");
    continue;
  end:
    puts("NO");
  }
  return 0;
}
