#include <bits/stdc++.h>
using namespace std;
int a[105][105], cnt[105];
int main() {
  int n, k, t;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> cnt[i];
    for (int j = 0; j < cnt[i]; ++j) {
      cin >> t;
      a[i][t]++;
    }
  }
  for (int i = 0; i < n; ++i) {
    int flag = 1;
    for (int j = 0; j < n && flag; ++j) {
      if (i == j) continue;
      flag = 0;
      for (int k = 1; k <= 100 && !flag; ++k) {
        if (a[j][k] && !a[i][k]) flag = 1;
      }
    }
    if (flag)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
