#pragma GCC optimize(2)
#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
int cnt=0,n,m,database[10002][11];
map<string,int>kafuu;
map<P,int>ans;
inline int id(string s){
if(!kafuu.count(s)) kafuu[s]=++cnt;
return kafuu[s];
}
int main(){
while(cin>>n>>m){
kafuu.clear(),cnt=0;getchar();
for(int i=1;i<=n;i++){
string s;
for(int j=1;j<=m-1;j++){
getline(cin,s,',');
database[i][j]=id(s);
}
getline(cin,s,'\n');
database[i][m]=id(s);
}
for(int j=1;j<=m-1;j++){
for(int k=j+1;k<=m;k++){
ans.clear();
for(int t=1;t<=n;t++){
if(ans.find(P(database[t][j],database[t][k]))!=ans.end()){
puts("NO");
cout<<ans[P(database[t][j],database[t][k])]<<" "<<t<<endl;
cout<<j<<" "<<k<<endl;
goto exit;
}
else ans[(P(database[t][j],database[t][k]))]=t;
}
}
}
puts("YES");
exit:;
}
}
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<string>
#include<iostream>
#include<map>
using namespace std;
typedef long long ll;
int n,m,id,v[10010][11];
char ch;
bool tf;
string str;
map<string,int>mp;
map<ll,int>q;
int main()
{
while(cin>>n>>m)
{
mp.clear();id=0;getchar();
for(int i=1;i<=n;i++)for(int j=1;j<=m;j++)
{
str.clear();
while(1)
{
ch=getchar();
if(ch==','||ch=='\n'||ch=='\r'||ch==EOF)break;
str.push_back(ch);
}
if(mp.count(str))v[i][j]=mp[str];
else v[i][j]=mp[str]=++id;
}
id++;tf=false;
for(int i=1;i<=m;i++)for(int j=1;j<i;j++)
{
q.clear();
for(int k=1;k<=n&&!tf;k++)if(q.count((ll)v[k][i]*id+v[k][j]))
{
printf("NO\n");
printf("%d %d\n%d %d\n",q[(ll)v[k][i]*id+v[k][j]],k,j,i);
tf=true;
}
else q[(ll)v[k][i]*id+v[k][j]]=k;
if(tf)break;
}
if(!tf)printf("YES\n");
}
return 0;
}