#include <bits/stdc++.h>

using namespace std;

#define  ll long long
#define ld long double
#define f first
#define s second


int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

    ll s,p;
    cin >> s >> p;

    for(ll i=1; i*i<=p; i++)
    {
        ll x = i , y = p/i;
        if (x*y == p && x+y==s) return cout << "Yes" << '\n' , 0;
    }

    cout << "No\n";


    return 0;
}
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define INF ((1LL<<62)-(1LL<<31))
typedef long long ll;

int main()
{
    int n;
    cin >> n;
    vector<ll> c(n*n);
    rep(i,n*n) cin >> c[i];
    ll mi=INF,ni;
    rep(i,n) {
        if(mi>c[i*n]) {
            mi=c[i*n];
            ni=i*n;
        }
    }
    vector<ll> v;
    rep(i,n) {
        ll check=c[i*n]-mi;
        bool flag=true;
        rep(j,n) if(c[i*n+j]-c[ni+j]!=check) flag=false; 
        //cout << check << endl;
        if(!flag) {
            cout << "No" << endl;
            return 0;
        }
        v.push_back(check);
    }
    cout << "Yes" << endl;
    rep(i,n) {
        if(i==0) cout << v[i];
        else cout << " " << v[i];
    }
    cout << endl;
    rep(i,n) {
        if(i==0) cout << c[ni];
        else cout << " " << c[ni+i];
    }
    cout << endl;
    return 0;
}