#include <bits/stdc++.h>
using namespace std;
void Print(int *arr, int sz) {
  int i = 0;
  while (i < sz) {
    printf("%d ", arr[i++]);
  }
  printf("\n");
}
void init() {}
int solve() { return 0; }
int main() {
  init();
  long long int t;
  {
    int n;
    n = ({
      int t;
      scanf("%d", &t);
      t;
    });
    vector<vector<int> > cards(n, vector<int>(101, 0));
    vector<int> c(n);
    for (int i = 0; i < n; i++) {
      int m = ({
        int t;
        scanf("%d", &t);
        t;
      });
      c[i] = m;
      for (int j = 0; j < m; j++) {
        int x = ({
          int t;
          scanf("%d", &t);
          t;
        });
        cards[i][x]++;
      }
    }
    for (int i = 0; i < n; i++) {
      bool flag = 1;
      for (int j = 0; j < n; j++) {
        if (i != j) {
          int cnt = 0;
          for (int k = 0; k < 101; k++) {
            if (cards[j][k] && (cards[i][k] == cards[j][k])) cnt++;
          }
          if (cnt == c[j]) flag = 0;
        }
        if (!flag) break;
      }
      if (flag)
        cout << "YES\n";
      else
        cout << "NO\n";
    }
  }
  return 0;
}
