#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return (b ? gcd(b, a % b) : a); }
long long w[111][111];
long long a[111];
long long b[111];
int main() {
  int n, m;
  cin >> n >> m;
  long long T = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> w[i][j];
      T = max(w[i][j], T);
    }
  }
  a[0] = 0;
  for (int j = 0; j < m; j++) {
    b[j] = w[0][j];
  }
  for (int i = 1; i < n; i++) {
    a[i] = w[i][0] - b[0];
  }
  long long k = w[0][0] - a[0] - b[0];
  bool f = true;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      long long m = abs(w[i][j] - a[i] - b[j]);
      if (m) f = false;
      k = gcd(m, k);
    }
  }
  if (f || k > T) {
    if (f) k = T + 1;
    long long t = (long long)1000000000000000000;
    for (int i = 0; i < n; i++) t = min(t, a[i]);
    for (int j = 0; j < m; j++) t = min(t, b[j]);
    if (t < 0) {
      long long mul = abs(t) / k;
      mul++;
      for (int i = 0; i < n; i++) a[i] += k * mul;
      for (int j = 0; j < m; j++) b[j] += k * mul;
    }
    cout << "YES\n" << k << endl;
    for (int i = 0; i < n; i++) cout << a[i] << " ";
    cout << endl;
    for (int j = 0; j < m; j++) cout << b[j] << " ";
  } else {
    cout << "NO";
  }
  return 0;
}
