#include <bits/stdc++.h>
using namespace std;
int R, C;
signed long long W[105][105];
signed long long my = 0, mx = 0;
signed long long A[105], B[105];
void solve() {
  int i, j, k, l, r, x, y;
  string s;
  cin >> R >> C;
  for (y = 0; y < R; y++)
    for (x = 0; x < C; x++) {
      cin >> W[y][x];
      if (W[y][x] < W[my][mx]) my = y, mx = x;
    }
  signed long long mo = 1LL << 40;
  A[my] = W[my][mx];
  for (x = 0; x < C; x++) B[x] = W[my][x] - A[my];
  for (y = 0; y < R; y++) A[y] = W[y][0] - B[0];
  for (y = 0; y < R; y++)
    for (x = 0; x < C; x++)
      if (W[y][x] != (A[y] + B[x])) mo = abs(A[y] + B[x] - W[y][x]);
  for (y = 0; y < R; y++) A[y] = (A[y] % mo + mo) % mo;
  for (x = 0; x < C; x++) B[x] = (B[x] % mo + mo) % mo;
  for (y = 0; y < R; y++)
    for (x = 0; x < C; x++)
      if (W[y][x] != (A[y] + B[x]) % mo) return (void)printf("NO\n");
  (void)printf("YES\n");
  (void)printf("%I64d\n", mo);
  for (y = 0; y < R; y++) (void)printf("%s%I64d", (y ? " " : ""), A[y]);
  (void)printf("\n");
  for (x = 0; x < C; x++) (void)printf("%s%I64d", (x ? " " : ""), B[x]);
  (void)printf("\n");
}
int main(int argc, char** argv) {
  string s;
  int i;
  if (argc == 1) ios::sync_with_stdio(false);
  for (i = 0; i < argc - 1; i++) s += argv[i + 1], s += '\n';
  for (i = 0; i < s.size(); i++) ungetc(s[s.size() - 1 - i], stdin);
  solve();
  return 0;
}
