#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
#include <set>
#include <tuple>
#define mkp make_pair
#define mkt make_tuple
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define all(v) v.begin(),v.end()
using namespace std;
typedef long long ll;
const ll MOD=1e9+7;
template<class T> void chmin(T &a,const T &b){if(a>b) a=b;}
template<class T> void chmax(T &a,const T &b){if(a<b) a=b;}

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

  int N;
  cin>>N;
  vector<vector<ll>> C(N,vector<ll> (N,0));
  rep(i,N) rep(j,N) cin>>C[i][j];

  vector<ll> A(N,0),B(N,0);
  int mir=0,mic=0;
  rep(i,N) rep(j,N) if(C[i][j]<C[mir][mic]) mir=i,mic=j;

  for(int i=0;i<N;i++) A[i]=C[i][mic]-C[mir][mic];
  for(int j=0;j<N;j++) B[j]=C[mir][j]-C[mir][mic];

  int diff=C[0][0]-(A[0]+B[0]);
  for(int i=0;i<N;i++) for(int j=0;j<N;j++){
      if(C[i][j]-(A[i]+B[j])!=diff){
          cout<<"No"<<endl;
          return 0;
      }
  }

  rep(i,N) A[i]+=diff;

  cout<<"Yes"<<endl;
  rep(i,N) cout<<A[i]<<" ";
  cout<<endl;
  rep(i,N) cout<<B[i]<<" ";
  cout<<endl;

  return 0;
}

#pragma GCC target ("avx2")
// #pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")

#include <iostream>
#include <array>
#include <algorithm>
#include <vector>
#include <bitset>
#include <set>
#include <unordered_set>
#include <cmath>
#include <complex>
#include <deque>
#include <iterator>
#include <numeric>
#include <map>
#include <unordered_map>
#include <queue>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <limits>
#include <iomanip>
#include <functional>
#include <cassert>
// #include <atcoder/all>
using namespace std;

using ll=long long;
template<class T> using V = vector<T>;
template<class T, class U> using P = pair<T, U>;
using vll = V<ll>;
using vii = V<int>;
using vvll = V<vll>;
using vvii = V< V<int> >;
using PII = P<int, int>;
using PLL = P<ll, ll>;
#define RevREP(i,n,a) for(ll i=n;i>a;i--)  // (a,n]
#define REP(i,a,n) for(ll i=a;i<n;i++)  // [a,n)
#define rep(i, n) REP(i,0,n)
#define ALL(v) v.begin(),v.end()
#define eb emplace_back
#define pb push_back
#define sz(v) int(v.size())

template < class T > inline bool chmax(T& a, T b) {if (a < b) { a=b; return true; } return false; }
template < class T > inline bool chmin(T& a, T b) {if (a > b) { a=b; return true; } return false; }
template< class A, class B > ostream& operator <<(ostream& out, const P<A, B> &p) {
    return out << '(' << p.first << ", " << p.second << ')';
}
template< class A > ostream& operator <<(ostream& out, const V<A> &v) {
    out << '[';
    for (int i=0;i<int(v.size());i++) {
        if (i) out << ", ";
        out << v[i];
    }
    return out << ']';
}

template<class A, class B> istream& operator >>(istream& in, P<A, B> &p) {
    return in >> p.first >> p.second;
}
template<class A> istream& operator >>(istream& in, V<A> &v) {
    for (int i = 0; i < int(v.size()); i++) in = in >> v[i];
    return in;
}

const long long MOD = 1000000007;
const long long HIGHINF = (long long)1e18;
const int INF = (int)1e9;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a, b; cin >> a >> b;
    if (a < b) {
        rep(i, b) cout << -(i + 1) << ' ';
        rep(i, a - 1) cout << i + 1 << ' ';
        int aaa = 0;
        REP(i, a, b + 1) aaa += i;
        cout << aaa << '\n';
    } else {
        rep(i, a) cout << i + 1 << ' ';
        rep(i, b - 1) cout << -(i + 1) << ' ';
        int aaa = 0;
        REP(i, b, a + 1) aaa += i;
        cout << -aaa << '\n';
    }
    return 0;
}
