def BFS(g,s):
queue=[s]
while queue:
v=queue.pop(0)
for nxt in g[v]:
if not visited[nxt]:
visited[nxt]=True
queue.append(nxt)
n=int(input())
visited=[False]*n
g=list([] for _ in range(n))
for i in range(n):
row=list(map(int,input().split()))
for j in range(1,len(row)):
g[i].append(row[j])
g[row[j]].append(i)
BFS(g,0)
if False in visited:
print("False")
else:
print("True")