#include <bits/stdc++.h>
using namespace std;
int n, i, j, i1, a[105][105], k, ans, x, m;
int main() {
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> m;
    for (j = 1; j <= m; j++) {
      cin >> x;
      a[i][x]++;
    }
  }
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) {
      for (i1 = 1; i1 <= 100; i1++) {
        if (a[j][i1] == 1 && a[i][i1] == 0) k++;
      }
      if (k > 0) ans++;
      k = 0;
    }
    if (ans == n - 1)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
    ans = 0;
  }
}
