#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
const int MOD = 1e9 + 7;
const int N = 5e5 + 100;
const double PI = 3.14159265359;
void solve() {
  int n;
  cin >> n;
  vector<int> d[1000], t(10000);
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    for (int j = 0; j < a; j++) {
      int b;
      cin >> b;
      d[i].push_back(b);
    }
  }
  for (int i = 0; i < n; i++) {
    int l = 0;
    for (int j = 0; j < n; j++) t[j] = 0;
    for (int j = 0; j < d[i].size(); j++) {
      for (int x = 0; x < n; x++) {
        for (int k = 0; k < d[x].size(); k++) {
          if (i != x) {
            if (d[i][j] == d[x][k]) t[x]++;
          }
        }
        if (t[x] == d[x].size()) {
          l = 3;
          break;
        }
      }
    }
    if (l != 3)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int TTT = 1;
  while (TTT--) {
    solve();
    cout << endl;
  }
}
