#include <bits/stdc++.h>
using namespace std;
int m[1000], a[101][101], b[1000];
vector<vector<int> > v(101);
int main() {
  int n, j, k;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> m[i];
    for (int j = 0; j < m[i]; j++) {
      cin >> a[i][j];
      v[a[i][j]].push_back(i);
    }
  }
  for (int i = 0; i < n; i++) {
    for (j = 0; j < n; j++) b[j] = m[j];
    for (j = 0; j < m[i]; j++) {
      int l = v[a[i][j]].size();
      for (k = 0; k < l; k++) {
        b[v[a[i][j]][k]]--;
      }
    }
    bool fl = 0;
    for (j = 0; j < n; j++) {
      if (j != i && b[j] == 0) {
        fl = 1;
        break;
      }
    }
    if (fl)
      puts("NO");
    else
      puts("YES");
  }
}
