#include <bits/stdc++.h>
using namespace std;
int c[105], a[105][105];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> c[i];
    for (int j = 1; j <= c[i]; j++) {
      cin >> a[i][j];
    }
  }
  for (int i = 1; i <= n; i++) {
    set<int> s;
    int num = 0;
    for (int j = 1; j <= c[i]; j++) {
      s.insert(a[i][j]);
    }
    for (int j = 1; j <= n; j++) {
      if (i == j) continue;
      int tag = 0;
      for (int k = 1; k <= c[j]; k++) {
        if (!s.count(a[j][k])) {
          tag = 1;
          break;
        }
      }
      num += tag;
    }
    if (num == n - 1)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
