#include <bits/stdc++.h>
using namespace std;

using ll = long long int;
using vll = vector<ll>;
ll const mod = 1e9 + 7;
#define endl "\n"
#define pb push_back
#define all(v) v.begin(),v.end()
#define rep(i,a,n) for(ll i=a;i<n;i++)
#define repr(i,a,n) for(ll i=a;i>=n;i--)
#define aashish_999 ios_base::sync_with_stdio(false);cin.tie(NULL)

int main()
{
    aashish_999;

    ll testcases = 1;
    //cin >> testcases;
    while(testcases--)
    {
        ll n;
        cin >> n;

        ll ans = 2;
        for(ll i = 3; i <= n; i++)
            ans = (ans * i) / __gcd(ans, i);

        cout << ans + 1 << endl;
    }

}
#include <bits/stdc++.h>
#define fo(a,b,c) for (a=b; a<=c; a++)
#define fd(a,b,c) for (a=b; a>=c; a--)
#define min(a,b) (a<b?a:b)
#define max(a,b) (a>b?a:b)
#define inf 2147483647
#define ll long long
//#define file
using namespace std;

int n,i,j,k,l;
int c[501][501];
int a[501],b[501];
ll A[501],B[501];
ll ma1,ma2,mb1,mb2;

void Exit()
{
	printf("No\n");
	exit(0);
}

int main()
{
	#ifdef file
	freopen("b.in","r",stdin);
	#endif
	
	scanf("%d",&n);
	fo(i,1,n)
	{
		fo(j,1,n)
		scanf("%d",&c[i][j]);
	}
	fo(i,2,n) a[i]=c[i][1]-c[1][1],ma1=min(ma1,a[i]),ma2=max(ma2,a[i]);
	fo(j,2,n) b[j]=c[1][j]-c[1][1],mb1=min(mb1,b[j]),mb2=max(mb2,b[j]);
	fo(j,1,n)
	{
		fo(i,2,n)
		if (c[i][j]-c[1][j]!=a[i])
		Exit();
	}
	fo(i,1,n)
	{
		fo(j,2,n)
		if (c[i][j]-c[i][1]!=b[j])
		Exit();
	}
	
	if (-ma1-mb1>c[1][1]) Exit();
	printf("Yes\n");
	A[1]=-ma1,B[1]=c[1][1]-A[1];
	fo(i,2,n) A[i]=a[i]+A[1],B[i]=b[i]+B[1];
	fo(i,1,n) printf("%lld ",A[i]);printf("\n");
	fo(i,1,n) printf("%lld ",B[i]);printf("\n");
	
	fclose(stdin);
	fclose(stdout);
	return 0;
}