#include <bits/stdc++.h>
using namespace std;
inline void Boost() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
const int NMAX = 105;
int n, vf[NMAX];
vector<int> v[NMAX];
int main() {
  Boost();
  int i, j;
  cin >> n;
  for (i = 1; i <= n; i++) {
    int m;
    cin >> m;
    v[i].resize(m);
    for (auto &it : v[i]) cin >> it;
    sort(v[i].begin(), v[i].end());
  }
  for (i = 1; i <= n; i++) {
    for (auto it : v[i]) vf[it] = 1;
    for (j = 1; j <= n; j++)
      if (i != j) {
        int cnt = 0;
        for (auto it : v[j])
          if (vf[it]) cnt++;
        if (cnt == v[j].size()) {
          cout << "NO\n";
          break;
        }
      }
    if (j == n + 1) cout << "YES\n";
    for (auto it : v[i]) vf[it] = 0;
  }
  return 0;
}
