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<bits/stdc++.h>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <chrono> 
#include<time.h>
#include <sys/time.h>
#include <unistd.h>
#include <algorithm> 
#include <fstream> 
#define pi 3.14159265
#define ss second
#define ff first
#define pb push_back
#define endl '\n'
// #include <typeinfo>
// #include<String>
bool time_seed = 0;



using namespace std;
using namespace std::chrono;

// ifstream cin;
// cin.open("input.txt");

typedef long long int ll;
typedef vector<int> vi; 
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<double> vd; 
typedef vector<vd> vvd;
typedef vector<vvd> vvvd;
typedef vector<bool> vb; 
typedef vector<vb> vvb;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<string> vs;
typedef vector<vs> vvs;
typedef vector<vvs> vvvs;
typedef vector<ll> vll; 
typedef vector<vll> vvll;
typedef pair<int,int> pii;
// typedef unordered_map ump;
// typedef unordered_map ump;
// #define unordered_map ump
// auto start = high_resolution_clock::now();
//     for(int i = 0;i<k;i++) s.lower_bound(i);
//     auto stop = high_resolution_clock::now(); 
//     auto duration = duration_cast<microseconds>(stop - start);
//     cout << "Time taken by function: "
//          << duration.count() << " microseconds" << endl; 
#define mod 1000000007
// #define mod 998244353
// #define unordered_map ump


struct ListNode {
    int val;
    ListNode *next;
    ListNode(int x) : val(x), next(NULL) {}
};  
struct TreeNode {
    int val;
    TreeNode *left;
    TreeNode *right;
    TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};


void show_vi(vector<int> t){
    // //cout<<"show_vi"<<endl;
    for(int i = 0;i<t.size();i++){
        cout<<t[i]<<",";
    }
    cout<<endl;
}

void show_vd(vector<double> t){
    // //cout<<"show_vi"<<endl;
    for(int i = 0;i<t.size();i++){
        cout<<t[i]<<",";
    }
    cout<<endl;
}
void show_vll(vector<ll> t){
    // //cout<<"show_vi"<<endl;
    for(int i = 0;i<t.size();i++){
        cout<<t[i]<<",";
    }
    cout<<endl;
}


void show_vt(vector<tuple<long long,long long>> t){
    // //cout<<"show_vi"<<endl;
    for(int i = 0;i<t.size();i++){
        cout<<get<0>(t[i])<<" "<<get<1>(t[i])<<"::";
    }
    cout<<endl;
}

void show_vb(vector<bool> t){
    // //cout<<"show_vi"<<endl;
    for(int i = 0;i<t.size();i++){
        cout<<t[i]<<" ";
    }
    cout<<endl;
}

void show_vvi(vector<vector<int>> ans){
    cout<<"---------------------------"<<endl;
    for(int i = 0;i<ans.size();i++){
        show_vi(ans[i]);
    }
    cout<<endl;
}

int randd(){
    // struct timeval end_time;
    timeval start_time;
    // cout<<"ok"<<endl;
    long milli_time, seconds, useconds;
    gettimeofday(&start_time, NULL);
    seconds = start_time.tv_sec;
    useconds = start_time.tv_usec;
    milli_time = ((seconds) * 1000 + useconds/1000.0);
    if(time_seed==0){
        time_seed = 1;
        srand(milli_time);
    }
    int k = rand();
    return k;
}

void show_vvvi(vvvi ans){
    for(int i = 0;i<ans.size();i++){
    cout<<"******************"<<endl;
        show_vvi(ans[i]);
    }
    cout<<endl;
}


void show_vvb(vector<vector<bool>> ans){
    cout<<"---------------------------"<<endl;
    for(int i = 0;i<ans.size();i++){
        show_vb(ans[i]);
    }
    cout<<endl;
}

void show_vs(vector<string> A){
    for(int i =0;i<A.size();i++){
        cout<<A[i]<<"::";
    }
    cout<<endl;
}

void show_vc(vector<char> A){
    for(int i =0;i<A.size();i++){
        cout<<A[i];
    }
    cout<<endl;
}

void show_vvc(vector<vector<char>> A){
    cout<<"---------------------------"<<endl;
    for(int i =0;i<A.size();i++){
        show_vc(A[i]);
    }
}

void show_vvs(vector<vector<string>> A){
    for(int i = 0;i<A.size();i++){
        show_vs(A[i]);
    }
}

void show_um(unordered_map<int,int> &map){
    unordered_map<int,int>::iterator it;
    it = map.begin();
    // int count = -6;
    while(it!=map.end()){
        cout<<it->ff<<" "<<it->second<<"::";
        // count ++;
        it++;
    }
    cout<<endl;
}

ll ncr(ll n, ll r) 
{ 
    // if(dp[n]!=-1) return dp[n];
    if (r > n - r) 
        r = n - r; 
    ll C[r + 1]; 
    memset(C, 0, sizeof(C)); 
  
    C[0] = 1; 
    for (ll i = 1; i <= n; i++) { 
        for (int j = min(i, r); j > 0; j--) {
                C[j] = (C[j] + C[j - 1]) ; 
                C[j]%=mod;
            }
    } 
    return C[r]; 
} 

int fact(int n){
    return (n==0)?1:(ll)(n*fact(n-1))%mod;
}

int hcf(int a,int b){
    if(a%b==0) return b;
    return hcf(b,a%b);
}


vll prime_factors(ll n){
    vll ans;
    while (n % 2 == 0)  
    {  
        ans.push_back(2);
        n = n/2;  
    }  
   
    for (int i = 3; i <= sqrt(n); i = i + 2)  
    {   
        while (n % i == 0)  
        {  
            ans.push_back(i);  
            n = n/i;  
        }  
    }  
    if (n > 2)  
        ans.push_back(n);
    return ans;
}

ll pow_m(ll a,ll b){
    // cout<<a<<" "<<b<<endl;
    if(b==1) return a%mod;
    if(b==0) return 1%mod;
    ll k = (ll)pow_m(a,b/2);
    if(b%2){
        return (((k*k)%mod)*a)%mod;
    }
    else return (((k*k)%mod));

}

int modInverse(int a, int m) 
{ 
    return pow_m(a,m-2); 
} 

bool isPrime(int n) 
{ 
    // Corner cases 
    if (n <= 1) 
        return false; 
    if (n <= 3) 
        return true; 
  
    // This is checked so that we can skip 
    // middle five numbers in below loop 
    if (n % 2 == 0 || n % 3 == 0) 
        return false; 
  
    for (int i = 5; i * i <= n; i = i + 6) 
        if (n % i == 0 || n % (i + 2) == 0) 
            return false; 
  
    return true; 
} 


string int_to_hex(int a){
    if(a==0) return "0";
    string ans;
    while(a){
        int k = a%16;
        if(k<=9){
            ans+=('0'+k);
        }
        else{
            ans+=('A'+(k-10));
        }
        a/=16;
    }
    reverse(ans.begin(), ans.end());
    return ans;
}



int cnt_digit(ll a){
    int ans = 0;
    while(a!=0){
        ans++;
        a/=10;
    }
    return ans;
}

ll ncrr(ll a,ll b){
    // cout<<a<<" "<<b<<endl;
    ll ans = 1;
    for(int i = 0;i<b;i++){
        ans*=a;
        a--;
        ans%=mod;
    }

    for(int i = 1;i<=b;i++){
        ans*=(modInverse(i,mod));
        ans%=mod;
    }
    return ans;
}
int n,m;
void NO(){
    cout<<"NO"<<endl;
}

bool check(set<int> &s,int i,vvi &A){
    // cout<<i<<" ";
    // show_vi(A[0]);
    if(i==A.size()) return 1;
    vi t;
    for(int j = 0;j<m;j++){
        if(A[0][j]!=A[i][j]) t.push_back(j);
    }
    if(t.size()<=2){
        return check(s,i+1,A);
    }
    int req = t.size()-2;
    if(req+s.size()>2) return 0;
    bool b =0;
    if(req==1){
        for(int j = 0;j<t.size();j++){
            if(s.find(t[j])==s.end()){
                s.insert(t[j]);
                int c = A[0][t[j]];
                A[0][t[j]] = A[i][t[j]];
                b|=check(s,1,A);
                if(b) return 1;
                A[0][t[j]] = c;
                s.erase(t[j]);
            }   
        }
    }
    else{
        for(int j = 0;j<t.size();j++){
            for(int k = j+1;k<t.size();k++){
                s.insert(t[j]);
                int a = A[0][t[j]];
                A[0][t[j]] = A[i][t[j]];
                s.insert(t[k]);
                int c = A[0][t[k]];
                A[0][t[k]] = A[i][t[k]];
                b=b||check(s,1,A);
                if(b) return 1;
                A[0][t[j]] = a;
                s.erase(t[j]);
                A[0][t[k]] = c;
                s.erase(t[k]);
            } 
        }
    }
    return b;
}


void transform(vvi &A){
    unordered_map<int,int> umap;
    int cnt = 1;
    for(int i = 0;i<n;i++){
        for(int j = 0;j<m;j++){
            if(umap.count(A[i][j])==0) umap[A[i][j]] = cnt++;
            A[i][j] = umap[A[i][j]];
        }
    }
}

void solve(){
    // int n,m;
    cin>>n>>m;
    vvi A(n,vi(m));
    for(int i = 0;i<n;i++)
        for(int j = 0;j<m;j++) cin>>A[i][j];

    // transform(A);
    // show_vvi(A);
    int cnt= 0;
    for(int i = 0;i<n;i++){
        cnt = 0;
        for(int j = 0;j<m;j++) if(A[i][j]!=A[0][j]) cnt++;
        if(cnt>4){
            NO();
            return;
        }
    }

    set<int> s;
    if(!check(s,1,A)) NO();
    else{
        cout<<"YES"<<endl;
        for(int i =0;i<m;i++) cout<<A[0][i]<<" ";
        cout<<endl;
    }
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);
    int t = 1;
    // cin>>t;
    for(int i = 1;i<=t;i++){
        solve();
    }
    return 0;
}