#include <bits/stdc++.h>
using namespace std;
int q, l, p, i, n, j, c[101], b[101], a[101][101];
int main() {
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> b[i];
    for (j = 0; j < b[i]; j++) cin >> c[j];
    sort(c, c + b[i]);
    for (j = 0; j < b[i]; j++) a[i][j] = c[j];
  }
  for (i = 0; i < n; i++) {
    p = 0;
    for (j = 0; j < n; j++) {
      l = 0;
      if (i == j) continue;
      for (q = 0; q < b[i]; q++) {
        if (a[i][q] == a[j][l]) l++;
        if (l == b[j]) {
          p = 1;
          break;
        }
      }
      if (p == 1) break;
    }
    if (p == 0)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
