#include <bits/stdc++.h>
using namespace std;
int n, m[111], a[111][111], d[111][111];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> m[i];
    for (int j = 1; j <= m[i]; j++) {
      cin >> a[i][j];
    }
  }
  int s;
  for (int i = 1; i <= n; i++) {
    int cur = 0;
    for (int k = 1; k <= n; k++) {
      s = 0;
      for (int j = 1; j <= m[i]; j++) {
        d[i][j] = 1;
        for (int l = 1; l <= m[k]; l++) {
          if (a[i][j] == a[k][l] && d[i][j] == 1 && i != k) {
            s++;
            d[i][j] = -1;
          }
        }
      }
      if (s == m[k] && m[i] >= m[k]) cur++;
    }
    if (cur >= 1) {
      cout << "NO" << endl;
    } else
      cout << "YES" << endl;
  }
  return 0;
}
