#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:36777216")
using namespace std;
const int N = 5e5 + 5;
const int MOD = 1e9 + 7;
const int INF = 1e9 + 7;
const double EPS = 1e-8;
int n, m, a[105][105];
long long ans[105];
int Gao(int r) {
  int mn = 1, mx = -1;
  for (int i = 1; i <= m; i++) {
    int t = a[r][i] - a[1][i];
    if (t >= 0) {
      if (mx == -1)
        mx = t;
      else if (mx != t)
        return -2;
    } else {
      if (mn == 1)
        mn = t;
      else if (mn != t)
        return -2;
    }
  }
  if (mn == 1 || mx == -1) return -1;
  return mx - mn;
}
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) cin >> a[i][j];
  long long op = -1;
  for (int i = 2; i <= n; i++) {
    int t = Gao(i);
    if (t == -2) {
      puts("NO");
      return 0;
    }
    if (op == -1)
      op = t;
    else if (t != -1 && t != op) {
      puts("NO");
      return 0;
    }
  }
  if (op == -1) op = ((long long)(1e10 + 7));
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (a[i][j] >= op) {
        puts("NO");
        return 0;
      }
  for (int i = 2; i <= n; i++) {
    if (a[i][1] - a[1][1] >= 0)
      ans[i] = a[i][1] - a[1][1];
    else
      ans[i] = op + a[i][1] - a[1][1];
  }
  puts("YES");
  cout << op << endl;
  for (int i = 1; i <= n; i++) cout << ans[i] << ' ';
  cout << endl;
  for (int i = 1; i <= m; i++) cout << a[1][i] << ' ';
  cout << endl;
}
