Problem: You are storing an integer array of length m in a database. To maintain internal integrity and protect data, the database stores n copies of this array.

Unfortunately, the recent incident may have altered the stored information in every copy in the database.

It's believed, that the incident altered at most two elements in every copy. You need to recover the original array based on the current state of the database.

In case there are multiple ways to restore the array, report any. If there is no array that differs from every copy in no more than two positions, report that as well.

Input

The first line contains integers n and m (2 ≤ n; 1 ≤ m; n ⋅ m ≤ 250 000) — the number of copies and the size of the array.

Each of the following n lines describes one of the currently stored copies in the database, it consists of m integers s_{i, 1}, s_{i, 2}, ..., s_{i, m} (1 ≤ s_{i, j} ≤ 10^9).

Output

If there is an array consistent with all given copies, print "Yes" and then the array itself. The array must have length m and contain integers between 1 and 10^9 only.

Otherwise, print "No".

If there are multiple possible arrays, print any of them.

Examples

Input


3 4
1 10 10 100
1 1 1 100
10 100 1 100


Output


Yes
1 10 1 100


Input


10 7
1 1 1 1 1 1 1
1 1 1 1 1 1 2
1 1 1 1 1 2 2
1 1 1 1 2 2 1
1 1 1 2 2 1 1
1 1 2 2 1 1 1
1 2 2 1 1 1 1
2 2 1 1 1 1 1
2 1 1 1 1 1 1
1 1 1 1 1 1 1


Output


Yes
1 1 1 1 1 1 1


Input


2 5
2 2 1 1 1
1 1 2 2 2


Output


No

Note

In the first example, the array [1, 10, 1, 100] differs from first and second copies in just one position, and from the third copy in two positions.

In the second example, array [1, 1, 1, 1, 1, 1, 1] is the same as the first copy and differs from all other copies in at most two positions.

In the third example, there is no array differing in at most two positions from every database's copy.

Solution (in CPP):

Solution:
#include<iostream>
#include<vector>
#include<utility>
#include<algorithm>
using namespace std;


const int N=25*10000+5;
vector<int> rig[N],a[N],compressed;
int n,m;

void finalchk(vector<int> &comp)
{
  for(int i=1;i<=n;i++)
  {
    int cnt=0;
    for(int j=1;j<=m;j++)  if(a[i][j] != comp[j])  cnt++;
    if(cnt>2) return;  
  }

  cout<<"Yes\n";
  for(int j=1;j<=m;j++)  cout<<compressed[comp[j]-1]<<" ";
  cout<<"\n";
  exit(0);
}

int cnt[N],temp[N];
bool visited[N],ssh[N];


void chk(int idx1,int idx2)
{ 
   vector<int>v;
   vector< pair<int,int> >vec;
   for(int i=2;i<=n;i++)
   {
      v.clear();
      for(int j=1;j<=m;j++)  if(j!=idx1 && j!=idx2 && a[i][j]!=a[1][j] )  v.push_back(j);
      if( (int)v.size() > 2 )  return;
      else if( (int)v.size() == 2 )
      {
         vector<int> comp(m+1);
         for(int j=1;j<=m;j++) comp[j]=a[1][j];
         comp[idx1]=a[i][idx1]; 
         comp[idx2]=a[i][idx2]; 
         finalchk(comp);
         return;
      }
      else if( (int)v.size() == 1 )  
      {
        ssh[i]=1;
        vec.emplace_back(a[i][idx1],a[i][idx2]);
      }
   }

   if(vec.empty())
   {
      cout<<"Yes\n";
      for(int j=1;j<=m;j++)  cout<<compressed[a[1][j]-1]<<" ";
      cout<<"\n";
      exit(0);  
   }
   
   vector<int>who,v2;
   int totalDiff=0;
   for(int i=2;i<=n;i++) 
   {
      if(ssh[i])
      {
        rig[a[i][idx1]].push_back(a[i][idx2]); 
        cnt[a[i][idx2]]++;
        if(cnt[a[i][idx2]]==1) totalDiff++;
        who.push_back(a[i][idx1]);
        v2.push_back(a[i][idx2]);
      }
   }
   
   for(auto &i: who)
   {
      if(!visited[i])
      {
        visited[i]=1;

        int diff=0;
        for(auto &j: rig[i]) 
        {
          temp[j]++;
          if(temp[j]==1)  diff++;
        }

        if(diff+1>=totalDiff)
        {
           bool ok=1;
           for(auto &j : rig[i])  if(temp[j]!=cnt[j] && temp[j]+n-1-(int)rig[i].size()!=cnt[j] )  ok=0;
           if(ok)
           {
              int other=-1;
              for(auto &j: v2)  if(temp[j]!=cnt[j])  other=j;
              if(other==-1)  other=1;
              cout<<"Yes\n";
              for(int j=1;j<=m;j++)
              {
                if(j==idx1)  cout<<compressed[i-1]<<" ";
                else if(j==idx2)  cout<<compressed[other-1]<<" ";
                else cout<<compressed[a[1][j]-1]<<" ";
              }  
              cout<<"\n";
              exit(0);
           } 
        }
        
        for(auto &j: rig[i]) temp[j]--;
      }
   }


   for(int i=2;i<=n;i++) 
   {
      if(ssh[i])
      {
        rig[a[i][idx1]].pop_back(); 
        cnt[a[i][idx2]]--;
      }
   }

   for(auto &i: who)   
   {
      visited[i]=ssh[i]=0;
   }
}

int main()
{
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  
  cin>>n>>m;
  for(int i=1;i<=n;i++)  a[i].resize(m+2);

  for(int i=1;i<=n;i++)  
  {
    for(int j=1;j<=m;j++)
    {
      cin>>a[i][j];
      compressed.push_back(a[i][j]);
    }
  }  

  if(m<=2)
  {
    cout<<"Yes\n";
    for(int j=1;j<=m;j++)  cout<<a[1][j]<<" ";
    cout<<"\n";
    return 0;  
  }

  sort(compressed.begin(),compressed.end());
  compressed.resize(unique(compressed.begin(), compressed.end()) - compressed.begin());

  for(int i=1;i<=n;i++)
  {
    for(int j=1;j<=m;j++)
    {
      a[i][j]=lower_bound(compressed.begin(),compressed.end(),a[i][j])-compressed.begin();
      a[i][j]++;
    }
  }
  
  for(int i=2;i<=n;i++)
  {
    vector<int>v;
    for(int j=1;j<=m;j++)  if(a[i][j]!=a[1][j])  v.push_back(j);
    if((int)v.size()>4)
    {
      cout<<"No\n";
      return 0;
    }
    else if((int)v.size()==4)
    {
       for(int j=0;j<4;j++) for(int z=0;z<4;z++)  if(j!=z) chk(v[j],v[z]);
       cout<<"No\n";
       return 0;
    }
    else if((int)v.size()==3)
    {
      for(int j=0;j<3;j++) for(int z=0;z<3;z++) if(j!=z) chk(v[j],v[z]);
      cout<<"No\n";
      return 0;
    }
  }

  cout<<"Yes\n";
  for(int j=1;j<=m;j++)  cout<<compressed[a[1][j]-1]<<" ";
  cout<<"\n";  

}