#include <bits/stdc++.h>
using namespace std;
long long x[110][110], n, m, i, j, Max, Min, L, a[110], b[110], a1, a2, k;
int main() {
  cin >> n >> m;
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; j++) {
      cin >> x[i][j];
      if (x[i][j] > Max) {
        Max = x[i][j];
        L = i;
      }
    }
  for (i = 2; i <= n; i++)
    for (j = 2; j <= m; j++) {
      a1 = x[i][j] + x[i - 1][j - 1];
      a2 = x[i][j - 1] + x[i - 1][j];
      if (a1 != a2) k = a1 < a2 ? a2 - a1 : a1 - a2;
    }
  if (k == 0)
    k = Max + 1;
  else if (k < Max) {
    cout << "NO";
    return 0;
  }
  for (i = 1; i <= n; i++) a[i] = x[i][1];
  for (j = 1; j <= m; j++) b[j] = (x[1][j] - a[1] + k) % k;
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; j++) {
      if ((a[i] + b[j]) % k != x[i][j]) {
        cout << "NO";
        return 0;
      }
    }
  cout << "YES\n" << k << '\n';
  for (i = 1; i <= n; i++) cout << a[i] << ' ';
  cout << '\n';
  for (i = 1; i <= m; i++) cout << b[i] << ' ';
  cout << '\n';
  return 0;
}
