#include <bits/stdc++.h>
using namespace std;
const int inf = 99999999;
bool have[105][105];
int sum[105];
int main() {
  int n;
  int m;
  while (cin >> n) {
    memset(have, false, sizeof(have));
    for (int i = 0; i < n; i++) {
      int x;
      cin >> sum[i];
      m = sum[i];
      while (m--) {
        cin >> x;
        have[i][x] = 1;
      }
    }
    int cont;
    int s = 999999;
    for (int i = 0; i < n; i++) {
      bool flag = 0;
      for (int j = 0; j < n; j++) {
        if (i == j) continue;
        int cont = 0;
        for (int k = 0; k <= 100; k++) {
          if (have[j][k] && have[i][k]) {
            cont++;
          }
        }
        if (cont == sum[j]) {
          flag = 1;
          break;
        }
      }
      if (!flag)
        cout << "YES" << endl;
      else
        cout << "NO" << endl;
    }
  }
  return 0;
}
