#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n][200];
  int b[n];
  int m, tmp;
  for (int i = 0; i < n; ++i) {
    cin >> b[i];
    int d[b[i]];
    for (int j = 0; j < b[i]; ++j) {
      cin >> d[j];
    }
    sort(d, d + b[i]);
    for (int j = 0; j < b[i]; ++j) a[i][j] = d[j];
  }
  int first;
  int dp[n];
  memset(dp, 0, sizeof dp);
  for (int i = 0; i < n; ++i) {
    first = 1;
    for (int j = 0; j < n; ++j) {
      if (i == j) continue;
      if (b[i] < b[j]) continue;
      int pos = 0;
      for (int k = 0; k < b[i] && pos < b[j]; ++k) {
        if (a[i][k] == a[j][pos]) {
          pos++;
        }
      }
      if (pos == b[j]) {
        first = 0;
        break;
      }
    }
    dp[i] = first;
  }
  for (int i = 0; i < n; ++i) {
    if (dp[i] == 1)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
