#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18;
long long a[200], b[200], w[200][200], e[200][200];
long long gcd(long long x, long long y) { return (y > 0) ? gcd(y, x % y) : x; }
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> w[i][j];
    }
  }
  a[0] = 0;
  for (int j = 0; j < m; j++) {
    b[j] = w[0][j] - a[0];
  }
  for (int j = 1; j < n; j++) {
    a[j] = w[j][0] - b[0];
  }
  long long gg = a[0] + b[0] - w[0][0];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      e[i][j] = abs(a[i] + b[j] - w[i][j]);
      gg = gcd(gg, e[i][j]);
    }
  }
  long long k = 0;
  if (gg == 0) {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        k = max(k, w[i][j] + 1);
      }
    }
    cout << "YES" << endl;
    cout << k << endl;
    for (int i = 0; i < n; i++) {
      if (a[i] < 0) {
        cout << w[i][0] + k - b[0] << ' ';
      } else {
        cout << a[i] << ' ';
      }
    }
    cout << endl;
    for (int i = 0; i < m; i++) {
      cout << b[i] << ' ';
    }
    cout << endl;
  } else {
    int flag = 0;
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        if (gg <= w[i][j]) {
          flag = 1;
          break;
        }
      }
    }
    if (flag) {
      cout << "NO" << endl;
    } else {
      cout << "YES" << endl;
      cout << gg << endl;
      for (int i = 0; i < n; i++) {
        cout << w[i][0] + gg - b[0] << ' ';
      }
      cout << endl;
      for (int i = 0; i < m; i++) {
        cout << b[i] << ' ';
      }
      cout << endl;
    }
  }
  return 0;
}
