#include <bits/stdc++.h>
using namespace std;
int a[110][110], x, n;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i][0];
    for (int j = 1; j <= a[i][0]; j++) {
      cin >> x;
      a[i][x] = 1;
    }
  }
  for (int i = 0; i < n; i++) {
    int ch = 1;
    for (int j = 0; j < n; j++) {
      if (i == j)
        continue;
      else {
        bool ch2 = 0;
        for (int k = 1; k <= 100; k++) {
          if (!a[i][k] && a[j][k]) {
            ch2 = 1;
            break;
          }
        }
        if (!ch2) {
          ch = 0;
          break;
        }
      }
    }
    if (ch)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
