#include using namespace std; int n, maxi; vector v[200005]; int last[1000005]; bool compSz(int x, int y) { return v[x].size() < v[y].size(); } bool insd(int x, set &s) { for(int val : v[x]) { if(s.find(val) == s.end()) return false; } return true; } int main() { ios_base::sync_with_stdio(false); cin.tie(0); cin>>n>>maxi; for(int i=1;i<=n;i++) { int nr; cin>>nr; while(nr) { nr--; int x; cin>>x; v[i].push_back(x); } } vector p; for(int i=1;i<=n;i++) p.push_back(i); sort(p.begin(), p.end(), compSz); for(int mulId : p) { set elemMele; for(int val : v[mulId]) elemMele.insert(val); set cop; for(int x : v[mulId]) if(last[x]) cop.insert(last[x]); for(int copId : cop) if(!insd(copId, elemMele)) { cout<<"YES\n"; cout<