#include using namespace std; #define fi first #define se second int n,m; int prv[1000005]; vectorv[200005]; pairst[200005]; int sx[1000005]; int main(){ ios::sync_with_stdio(false);cin.tie(0); cin >> n >> m; for(int i=1; i<=n ;i++){ int k;cin >> k; v[i].resize(k); for(auto &c:v[i]) cin >> c; st[i]={k,i}; } sort(st+1,st+n+1); for(int i=1; i<=n ;i++){ int x=st[i].se; for(auto c:v[x]){ if(prv[c]!=0){ sx[prv[c]]++; } } for(auto c:v[x]){ if(prv[c]!=0){ if(sx[prv[c]]!=v[prv[c]].size()){ cout << "YES\n"; cout << prv[c] << ' ' << x << '\n'; return 0; } } } for(auto c:v[x]){ if(prv[c]!=0){ sx[prv[c]]=0; } prv[c]=x; } } cout << "NO\n"; }