n=int(input()) uf=[*range(n)] def find(x): q=[] while uf[x]^x:q+=x,;x=uf[x] for p in q:uf[p]=x return x def unite(x,y): x,y=find(x),find(y) if x^y:uf[x]=y for i in range(n): m,*a=map(int,input().split()) for j in a: unite(i,j-1) s=set() for i in range(n): s|={find(i)} if len(s)==1: print('Yes') else: print('No')