#include using namespace std; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); int n, m; cin >> n >> m; vector>> v(n); for(int i = 0; i < n; ++i){ int k; cin >> k; v[i].second.resize(k); v[i].first = i; for(auto &x : v[i].second)cin >> x; } sort(v.begin(), v.end(), [&](pair> &a, pair> &b){ return a.second.size() > b.second.size(); }); vector ans(m + 1, -1); for(int i = 0; i < n; ++i){ if(!v[i].second.size())continue; vector cu; for(int j = 0; j < (int)v[i].second.size(); ++j){ cu.push_back(ans[v[i].second[j]]); ans[v[i].second[j]] = i; } sort(cu.begin(), cu.end()); if(cu[0] == cu.back())continue; else{ cout << "YES\n"; cout << v[i].first + 1 << ' ' << v[cu.back()].first + 1 << '\n'; return 0; } } cout << "NO\n"; }