#include <bits/stdc++.h>
int main() {
  int n;
  scanf("%d", &n);
  int arr[n][100];
  for (int i = 0; i < n; i++) {
    scanf("%d", &arr[i][0]);
    for (int j = 1; j <= arr[i][0]; j++) {
      scanf("%d", &arr[i][j]);
    }
  }
  int ch;
  for (int i = 0; i < n; i++) {
    int num[n], ch = 0;
    for (int k = 0; k < n; k++) num[k] = arr[k][0];
    for (int j = 1; j <= arr[i][0]; j++) {
      for (int k = 0; k < n; k++) {
        if (k == i) continue;
        for (int l = 1; l <= arr[k][0]; l++) {
          if (arr[i][j] == arr[k][l]) {
            num[k]--;
            if (num[k] == 0) {
              ch = 1;
            }
            break;
          }
        }
        if (ch == 1) break;
      }
      if (ch == 1) break;
    }
    if (ch == 0)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
