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