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