#include <bits/stdc++.h>
using namespace std;
bool f = true;
long long n, i, j, k, a[100][101];
bool same(long long p, long long q) {
  bool tf;
  for (long long o = 1; o <= a[q][0]; o++) {
    tf = false;
    for (long long l = 1; l <= a[p][0]; l++)
      if (a[q][o] == a[p][l]) {
        tf = true;
        break;
      }
    if (tf == false) return (false);
  }
  return (true);
}
int main() {
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a[i][0];
    for (j = 1; j <= a[i][0]; j++) cin >> a[i][j];
  }
  for (i = 0; i < n; i++) {
    f = true;
    for (j = 0; j < n; j++)
      if (i != j && same(i, j)) {
        f = false;
        break;
      }
    if (f)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
