#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <tuple>
#include <unordered_map>
#include <vector>

// #include <atcoder/all>
/*
cd $dir && g++ -std=c++17 -Wall -Wextra -O2 -DATCODERDEBUG
-I/mnt/d/MyProjects/atcoder/lib/ac-library $fileName && echo 'compilation ok!'
&&  ./a.out
*/
using namespace std;
#define REP(i, n) for (ll i = 0; i < ll(n); i++)
#define FOR(i, a, b) for (ll i = a; i <= ll(b); i++)
#define ALL(x) x.begin(), x.end()
#define dame(a)        \
  {                    \
    cout << a << endl; \
    return 0;          \
  }
typedef long long ll;

class dstream : public ostream {};

template <typename T>
dstream &operator<<(dstream &os, T v) {
#ifdef ATCODERDEBUG
  cout << "\033[1;31m" << v << "\033[0m";
#endif
  return os;
}

ostream &endd(std::ostream &out) {
#ifdef ATCODERDEBUG
  out << std::endl;
#endif
  return out;
}
dstream dout;

template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  os << "[ ";
  for (auto const &x : v) {
    os << x;
    if (&x != &v.back()) {
      os << " : ";
    }
  }
  os << " ]" << endl;
  return os;
}

template <typename T>
ostream &operator<<(ostream &os, const vector<vector<T>> &v) {
  os << "[" << endl;
  for (auto const &x : v) {
    os << " ";
    os << x;
  }
  os << "]" << endl;
  return os;
}

template <typename T, typename U>
ostream &operator<<(ostream &os, const pair<T, U> &v) {
  os << "[ " << v.first << " " << v.second << " ]" << endl;
  return os;
}

template <typename T, typename U, typename Comp = less<>>
bool chmax(T &xmax, const U &x, Comp comp = {}) {
  if (comp(xmax, x)) {
    xmax = x;
    return true;
  }
  return false;
}

template <typename T, typename U, typename Comp = less<>>
bool chmin(T &xmin, const U &x, Comp comp = {}) {
  if (comp(x, xmin)) {
    xmin = x;
    return true;
  }
  return false;
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);

  ll N;
  cin >> N;
  vector<vector<ll>> C(N, vector<ll>(N, 0));
  REP(i, N) {
    REP(j, N) { cin >> C[i][j]; }
  }

  // check
  for (ll i = 1; i < N; i++) {
    ll d = C[i][0] - C[0][0];
    for (ll j = 1; j < N; j++) {
      if (C[0][j] + d != C[i][j]) {
        dout << "no1" << endd;
        cout << "No" << endl;
        return 0;
      }
    }
  }

  ll upper = 1e12;
  REP(j, N) { chmin(upper, C[0][j]); }

  ll downer = 0;
  for (ll i = 1; i < N; i++) {
    ll e = C[i][0] - C[0][0];
    chmax(downer, -e);
  }

  if (downer > upper) {
    cout << "No" << endl;
    return 0;
  }

  ll d = downer;
  cout << "Yes" << endl;
  // A
  REP(i, N) {
    cout << (C[i][0] - C[0][0] + d);
    if (i != N - 1)
      cout << " ";
    else
      cout << endl;
  }
  // B
  REP(j, N) {
    cout << (C[0][j] - d);
    if (j != N - 1)
      cout << " ";
    else
      cout << endl;
  }
  // cout << std::fixed << std::setprecision(15) << sqrt(ans) << endl;
}
#include <bits/stdc++.h>
#include <cmath>

#define  fl(i,a,b) for(long long i=a;i<b;i++)
#define  test long long t_c;cin>>t_c;for(long long ks=1;ks<=t_c;ks++)
#define pb push_back
#define vi vector<int>
#define all(x) x.begin(),x.end()
#define cy cout<<"YES\n";
#define cn cout<<"NO\n";
#define nl cout<<endl;
#define case(x) cout<<"Case "<<x<<": ";



typedef long long ll;
typedef long long int lli;
void sc(int &x){scanf("%d",&x);}
void sc(lli &x){scanf("%lld",&x);}
void sc(char *x){scanf("%s",x);}
void sc(double &x){scanf("%lf",&x);}

using namespace std;
int main()
{
   ios_base::sync_with_stdio(false);
   lli a,b;
   cin>>a>>b;
   if(abs(a-b)<3)
   {
       cout<<"Yes\n";
   }
   else
   {
       cout<<"No\n";
   }


}
