#include using namespace std; #define FOR(i, a, b) for(int i = (a); i < (b); i++) #define RFOR(i, a, b) for(int i = (a) - 1; i >= (b); i--) #define SZ(a) int(a.size()) #define ALL(a) a.begin(), a.end() #define PB push_back #define MP make_pair #define F first #define S second typedef long long LL; typedef vector VI; typedef pair PII; typedef double db; VI read() { int k; cin >> k; VI a(k); FOR(i, 0, k) { cin >> a[i]; a[i]--; } return a; } int main() { ios::sync_with_stdio(0); cin.tie(0); int n, m; cin >> n >> m; vector> a(n); FOR(i, 0, n) a[i] = MP(read(), i); sort(ALL(a), [](const pair& i, const pair& j){return SZ(i.F) < SZ(j.F);}); VI c(m, -1); FOR(i, 0, n) { map cnt; for(int x : a[i].F) { if(c[x] != -1) cnt[c[x]]++; } for(auto [k, ck] : cnt) { if(SZ(a[k].F) == ck) continue; cout << "YES\n"; cout << a[i].S + 1 << " " << a[k].S + 1 << "\n"; exit(0); } for(int x : a[i].F) c[x] = i; } cout << "NO\n"; return 0; }