#include<bits/stdc++.h>
using namespace std;
//#include<atcoder/all>
//using namespace atcoder;
using ll = long long;
using ull = unsigned long long;
#define rep(i,n) for(int i=0;i<(n);++i)

int main(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int n;
	cin >> n;
	vector<vector<int>> g(n);
	for(int i=0;i<n;++i){
		int m;
		cin >> m;
		for(int j=0;j<m;++j){
			int v;
			cin >> v;
			--v;
			g[i].emplace_back(v);
		}
	}
	vector<bool> seen(n);
	auto dfs = [&] (auto dfs,int v) -> void{
		seen[v] = true;
		for(auto next : g[v]){
			if(seen[next])continue;
			dfs(dfs,next);
		}
	};
	
	dfs(dfs,0);
	for(int i=0;i<n;++i){
		if(!seen[i]){
			cout << "No" << endl;
			return 0;
		}
	}
	cout << "Yes" << endl;
}