// #pragma GCC optimize("Ofast")
// #pragma GCC target("avx,avx2,fma")
// #pragma GCC optimization ("unroll-loops")
#include <algorithm>
#include<bits/stdc++.h>
#include <cstdarg>
#include <cstdint>
#include <cstring>
#include <iomanip>
#include <math.h>
#include <vector>

// @author : sam000013

#define int long long
#define PI 3.14159265
#define pb(x) push_back(x)
#define all(v) v.begin(), v.end()   
#define dbg(x) cout<<#x<<" "<<x<<endl;
#define bye cout<<endl;return
#define uni 1.000000
#define ld long double
using namespace std;

const int mod = 1000000007;
const int hashMod = 29996224275833;
template <typename T>

void show(vector<T> x)
{
    for (auto e : x){
        cout<<e<<" ";
    }
    cout<<endl;
}
template <typename T1>
void showPair(vector<pair<T1, T1>> x) {
    for(auto e:x){
        cout<<e.first<<" "<<e.second<<endl;
    }
}
template <typename T2>
void showSet(set<T2> x) {
    for(auto e:x){
        cout<<e<<" ";
    }
    cout<<endl;
}
template <typename T3>
void showMultiSet(multiset<T3> x) {
    for(auto e:x){
        cout<<e<<" ";
    }
    cout<<endl;
}

/*
for(int i=0; i<n; i++){
    for(int j=0; j<m; j++){

    }
}  
*/
void solve(){
    int n;
    cin>>n;
    vector<vector<int>> v(n, vector<int>(n));
    for(int i=0; i<n; i++){
        for(int j=0;j<n;j++){
            cin>>v[i][j];
        }
    }
    for(int i=0; i<n; i++){
        
        vector<int> canbe;
        for(int j=0; j<n; j++){
            int diff;
            bool ok = 1;
            for(int k=0; k<n; k++){
                if(k == 0){
                    if(v[j][k] - v[i][k] >= 0){
                        diff = v[j][k] - v[i][k];
                    }else{
                        ok = 0;
                        break;
                    }
                }else{
                    if(v[j][k] - v[i][k] != diff){
                        ok = 0;
                        break;
                    }
                }
            }
            if(ok){
                canbe.push_back(diff);
            }else{
                break;
            }
        }
        if(canbe.size() == n){
            cout<<"Yes\n";
            for(int j=0; j<n; j++){
                cout<<canbe[j]<<" ";
            }cout<<"\n";
            for(int j=0; j<n; j++){
                cout<<v[i][j]<<" ";
            }cout<<"\n";
            
            return;
        }
    }
    cout<<"No";bye;
}
signed main(){
    ios::sync_with_stdio(false);cin.tie(NULL);
    int t   = 1;
    // cin >> t;
    for(int i=1; i<=t; i++){
        solve();
    }
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define   NeedForSpeed  ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define   int           long long int
#define   fi            first
#define   se            second
#define   pub           push_back
#define   pi            pair<int,int>
#define   all(x)        (x).begin(), (x).end()
#define   rep(i, l, r)  for(int i=(int)(l);i<(int)(r);i++)
#define   repd(i, l, r) for (int i=(int)(l);i>=(int)(r);i--)
#define   clrg(i, l, r) for(int i=(int)(l);i<(int)(r);i++)vis[i]=0,v[i].clear();
int power(int x, unsigned int y){int res = 1;while (y > 0){ if (y & 1){res = res*x;} y = y>>1;x = x*x;}return res;}
int powermod(int x, unsigned int y, int p){int res = 1;x = x % p;while (y > 0){if (y & 1){res = (res*x) % p;}y = y>>1; x = (x*x) % p;}return res;}
#define   print2d(mat,n,m){for(int i=0;i<(int)(n);i++){for(int j=0;j<(m);j++){cout<<mat[i][j]<<" ";}cout<< endl;}}
#define   clr(a,x)      memset(a,x,sizeof(a))
#define   rr(v)         for(auto &val:v)
#define   print(v)      for (const auto itr : v){cout<<itr<<' ';}cout<<"\n";
#define   len           length()
#define   sz            size()
#define   mod           1000000007
#define   elif          else if
#define   filein(x)     ifstream fin (x);
#define   fileout(x)    ofstream fout (x);
 
 
int32_t main(){
    NeedForSpeed

    int n;cin>>n;
    int ans=1;
    for(int i=n;i>=2;i--){
        if(__gcd(i,ans)==1){ans*=i;}
        else{
            ans*=i/(__gcd(ans,i));
        }
    }
    cout<<(ans+1)<<endl;
}
