#include <bits/stdc++.h>
using namespace std;
const int size = 111;
const long long modulo = 1000000007;
const long long INF = 1e14;
const double EPS = 1e-10;
vector<vector<int> > a;
int main() {
  cin.sync_with_stdio(0);
  int n;
  cin >> n;
  a.resize(n);
  for (int i = 0; i < n; i++) {
    int k;
    cin >> k;
    a[i].resize(k);
    for (int j = 0; j < k; j++) cin >> a[i][j];
    sort(a[i].begin(), a[i].end());
  }
  vector<bool> ok(n, true);
  for (int i = 0; i < n; i++) {
    int pos;
    for (int j = 0; j < n; j++) {
      if (i == j) continue;
      pos = 0;
      for (int l = 0; l < a[j].size() && pos < a[i].size(); l++)
        if (a[j][l] == a[i][pos])
          ++pos;
        else if (a[j][l] > a[i][pos])
          break;
      if (pos == a[i].size()) ok[j] = false;
    }
  }
  for (int i = 0; i < n; i++) cout << (ok[i] ? "YES\n" : "NO\n");
  return 0;
}
