#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <sstream>
#include <stdio.h>
#include <cmath>
#include <cctype>
#include <map>
#include <queue>
#include <set>

#define INT_INF 1e9
#define LONG_INF 1e18
#define MOD 1e9 + 7
#define PI 3.14159265358979323846

typedef long long ll;

using namespace std;

int main()
{
    int n;
    cin >> n;
    if (n == 0)
    {
        cout << "Yes" << endl;
        return 0;
    }
    while (n % 10 == 0)
    {
        n = n / 10;
    }
    string a = to_string(n);
    int i = 0, j = a.length() - 1;
    bool f = true;
    while (i < j)
    {
        if (a[i] != a[j])
        {
            f = false;
            break;
        }
        i += 1;
        j -= 1;
    }
    if (f)
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }
    return 0;
}
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef long double ld;
#define FOR(i, a, b) for (int i = a; i < (b); i++)
#define range(a) a.begin(), a.end()
#define endl "\n"
#define Yes() cout << "Yes" << endl
#define No() cout << "No" << endl
#define MP make_pair
using P = pair<int, int>;
const unsigned long long mod = 1e9 + 7;
const long long INF = 1LL<<60;
void chmin(long long &a, long long b) { if (a > b) a = b; }
void chmax(long long &a, long long b) { if (a < b) a = b; }

int main(void){
	ios::sync_with_stdio(0);
	cin.tie(0);
	int N;
	cin >> N;
	vector<ll> A(N, 0), B(N, 0);
	ll amin = INF, bmin = INF;
	vector<vector<ll>> C(N, vector<ll>(N, 0));
	FOR(i,0,N){
		FOR(j,0,N){
			ll c;
			cin >> c;
			C[i][j] = c;
			A[i] += c;
			B[j] += c;
		}
	}


	FOR(i,0,N){
		amin = min(amin, A[i]);
		bmin = min(bmin, B[i]);
	}

	FOR(i,0,N){
		A[i] -= amin;
		B[i] -= bmin;
	}

	FOR(i,0,N){
		if(A[i] % N != 0 || B[i] % N != 0){
			No();
			return 0;
		}
		A[i] /= N;
		B[i] /= N;
	}


	ll add = C[0][0] - A[0] - B[0];



	if(add < 0){
		No();
		return 0;
	}

	FOR(i,0,N){
		B[i] += add;
	}

	FOR(i,0,N){
		FOR(j,0,N){
			if(A[i] + B[j] != C[i][j]){
				No();
				return 0;
			}
		}
	}

	Yes();
	FOR(i,0,N){
		cout << A[i] << " ";
	}
	cout<<endl;
	FOR(i,0,N){
		cout << B[i] << " ";
	}

	return 0;
}

