#include <bits/stdc++.h>
/*#include <cstdio>
#include <algorithm>
#include <iostream>
#include <cmath>
#include <cstring>
#include <string>*/
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int maxn=2e5+10;
const int mod=998244353;
const int inf=0x3f3f3f3f;
int n,T,a[maxn],m;
double k[maxn],b[maxn],sumk,sumb;
int main()
{
	cin>>n>>m>>T;
	int cnt=1;
	int jb=T;
	while(T--)
	{
		int y;
		cin>>y;
		a[y]=1;
		if(a[y-1]==1)
			cnt++;
		else
		{
			if(cnt>=m)
			{
				printf("-1");
				return 0;
			}
			cnt=1;
		}
	}
	if(cnt>=m&&jb!=0)
	{
		printf("-1");
		return 0;
	}
	for(int i=n-1;i>=0;i--)
	{
		sumk=sumk+k[i+1]-k[i+m+1];
		sumb=sumb-b[i+m+1]+b[i+1];
		if(a[i]==1)
		{
			k[i]=1;
			continue;
		}
		k[i]=sumk;
		b[i]=sumb;
		b[i]/=(double)m;
		k[i]/=(double)m;
		b[i]++;
	//	printf("%d %lf %lf\n",i,k[i],b[i]);
	}
	if(k[0]==1)
		printf("-1");
	else
		printf("%.4lf",(-b[0])/(k[0]-1));
	return 0;
}

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

//#define FILE
#define int long long
#define debug(x) cout << #x << " = " << x << endl
#define file(FILENAME) freopen(FILENAME".in", "r", stdin), freopen(FILENAME".out", "w", stdout)
#define LINE() cout << "LINE = " << __LINE__ << endl
#define LL long long
#define ull unsigned long long
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define fst first
#define scd second
#define inv(x) qpow((x),mod - 2)
#define lowbit(x) ((x) & (-(x)))
#define abs(x) ((x) < 0 ? (-(x)) : (x))
#define randint(l, r) (rand() % ((r) - (l) + 1) + (l))
#define vec vector

const int MAXN = 510;
const int INF = 2e11;
const double PI = acos(-1);
const double eps = 1e-6;
//const int mod = 1e9 + 7;
//const int mod = 998244353;
//const int G = 3;
//const int base = 131;

int n, m;
int c[MAXN][MAXN], tmp[MAXN][MAXN];
int a[MAXN], b[MAXN], sum;

template<typename T> inline bool read(T &a) {
	a = 0; char c = getchar(); int f = 1;
	while(c < '0' || c > '9') {if(c == '-') f = -1; c = getchar();}
	while(c >= '0' && c <= '9') {a = a * 10 + (c ^ 48); c = getchar();}
	a *= f;
	return 1;
}

template<typename A, typename ...B>
inline bool read(A &x, B &...y) {return read(x) && read(y...);}

signed main () {
#ifdef FILE
	freopen(".in","r",stdin);
	freopen(".out","w",stdout);
#endif
	read(n);
	for(int i = 1; i <= n; ++i) 
		for(int j = 1; j <= n; ++j)
			read(c[i][j]);
	b[1] = c[1][1];
	for(int i = 2; i <= n; ++i)
		b[i] = b[i - 1] + c[1][i] - c[1][i - 1];
	for(int i = 1; i <= n; ++i)
		a[i] = c[i][i] - b[i];
	sum = INF;
	for(int i = 1; i <= n; ++i) sum = min(sum, b[i]);
	for(int i = 1; i <= n; ++i) {
		a[i] += sum, b[i] -= sum;
		if(a[i] < 0 || b[i] < 0) return puts("No"), 0;
	}
	for(int i = 1; i <= n; ++i)
		for(int j = 1; j <= n; ++j)
			if(a[i] + b[j] != c[i][j]) return puts("No"), 0;
	puts("Yes");
	for(int i = 1; i <= n; ++i) cout << a[i] << ' ';
	cout << endl;
	for(int i = 1; i <= n; ++i) cout << b[i] << ' ';
	cout << endl;
	return 0;
}
