#include <bits/stdc++.h>
using namespace std;
using namespace std;
const long long INF = 100000000000000000LL;
int abs(int x) { return x > 0 ? x : -x; }
int main() {
  int n, m[120], ans[120], a[120][120], use[120];
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> m[i];
    for (int j = 0; j < m[i]; j++) {
      cin >> a[i][j];
    }
    sort(a[i], a[i] + m[i]);
  }
  for (int i = 0; i < n; i++) {
    ans[i] = 1;
    for (int j = 0; j <= 100; j++) use[j] = 0;
    for (int j = 0; j < m[i]; j++) use[a[i][j]] = 1;
    for (int j = 0; j < n; j++) {
      if (i != j) {
        bool f = 1;
        for (int k = 0; k < m[j] && f; k++) {
          if (use[a[j][k]] == 0) {
            f = 0;
            break;
          }
        }
        if (f) {
          ans[i] = 0;
          break;
        }
      }
    }
  }
  for (int s = 0; s < n; s++) {
    if (ans[s] == 1)
      puts("YES");
    else
      puts("NO");
  }
  return 0;
}
