#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const int INF = 0x3f3f3f3f;
const double eps = 1e-8;
const int MAXN = 8000000;
bitset<102> mask[102];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < (n); ++i) {
    int m;
    scanf("%d", &m);
    for (int j = 0; j < (m); ++j) {
      int x;
      scanf("%d", &x);
      mask[i].set(x);
    }
  }
  for (int i = 0; i < (n); ++i) {
    bool ok = true;
    for (int j = 0; j < (n); ++j)
      if (i != j) {
        if (mask[i] == (mask[i] | mask[j])) {
          ok = false;
          break;
        }
      }
    puts(ok ? "YES" : "NO");
  }
  return 0;
}
