#include <bits/stdc++.h>
using namespace std;
int n;
int m[111];
bool a[111][111];
bool b[111][111];
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> m[i];
    for (int j = 0; j < m[i]; ++j) {
      int t;
      cin >> t;
      a[i][t - 1] = true;
    }
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      for (int k = 0; k < 100; ++k) {
        b[j][k] = a[j][k];
      }
    }
    for (int k = 0; k < 100; ++k) {
      if (b[i][k]) {
        for (int j = 0; j < n; ++j) {
          b[j][k] = false;
        }
      }
    }
    bool pos = true;
    for (int j = 0; j < n; ++j) {
      bool left = false;
      for (int k = 0; k < 100; ++k) {
        if (b[j][k]) {
          left = true;
        }
      }
      if (!left && j != i) {
        pos = false;
      }
    }
    if (pos) {
      cout << "YES\n";
    } else {
      cout << "NO\n";
    }
  }
  return 0;
}
