#include <iostream>
#include <bits/stdc++.h>
#define maxn 100001
using namespace std;
map<string,int>IDcache;
vector<string>data;
map<pair<int,int>,int>mp;
int a[maxn][15];
int main()
{
int r,c;
string s,s0;
while(cin>>r>>c)
{
getchar();
for(int i = 0;i<r;i++)
{
int xcol = 0;
getline(cin,s);
for(int j = 0;j<s.size();j++)
{
if(s[j]==','||j==s.size()-1)
{
if(j==s.size()-1)
s0+=s[j];
if(!IDcache[s0])
{
data.push_back(s0);
IDcache[s0] = data.size()-1;
}
a[i][xcol++] = IDcache[s0];
s0 = "";
}
else
s0+=s[j];
}
}
// for(int i = 0;i<r;i++)
// {
// for(int j = 0;j<c;j++)
// {
// cout<<a[i][j]<<" ";
// }
// cout<<endl;
// }
int flag = 1;
for(int i = 0;i<c-1;i++)
{
if(!flag) break;
for(int j = i+1;j<c;j++)
{
mp.clear();
if(!flag) break;
for(int k = 0;k<r;k++)
{
int c1 = a[k][i];
int c2 = a[k][j];
if(!mp.count(make_pair(c1,c2)))
{
mp[make_pair(c1,c2)] = k;
}
else
{
cout<<"NO"<<endl;
cout<<mp[make_pair(c1,c2)]+1<<" "<<k+1<<endl;
cout<<i+1<<" "<<j+1<<endl;
flag = 0;
break;
}
}
}
}
if(flag) cout<<"YES"<<endl;
}
return 0;
}
/**
3 3
How to compete in ACM ICPC,Peter,peter@neerc.ifmo.ru
How to win ACM ICPC,Michael,michael@neerc.ifmo.ru
Notes from ACM ICPC champion,Michael,michael@neerc.ifmo.ru
2 3
1,Peter,peter@neerc.ifmo.ru
2,Michael,michael@neerc.ifmo.ru
**/