#include <bits/stdc++.h>
using namespace std;
int mv = 1000000007;
int w[105][105];
int main() {
  int n, m, max_el = 0;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> w[i][j];
      max_el = max(max_el, w[i][j]);
    }
  }
  int k = mv;
  for (int i = 1; i < n; i++) {
    set<int> temp_diff;
    for (int j = 0; j < m; j++) {
      temp_diff.insert(w[i][j] - w[i - 1][j]);
    }
    if (temp_diff.size() > 2) {
      cout << "NO" << endl;
      return 0;
    }
    if (temp_diff.size() == 2) {
      set<int>::iterator blah = temp_diff.begin();
      blah++;
      int temp_k = *(blah) - *(temp_diff.begin());
      if (k == mv || k == temp_k)
        k = temp_k;
      else {
        cout << "NO" << endl;
        return 0;
      }
    }
  }
  for (int j = 1; j < m; j++) {
    set<int> temp_diff;
    for (int i = 0; i < n; i++) {
      temp_diff.insert(w[i][j] - w[i][j - 1]);
    }
    if (temp_diff.size() > 2) {
      cout << "NO" << endl;
      return 0;
    }
    if (temp_diff.size() == 2) {
      set<int>::iterator blah = temp_diff.begin();
      blah++;
      int temp_k = *(blah) - *(temp_diff.begin());
      if (k == mv || k == temp_k)
        k = temp_k;
      else {
        cout << "NO" << endl;
        return 0;
      }
    }
  }
  if (k <= max_el) {
    cout << "NO" << endl;
    return 0;
  }
  int min_idx = 0;
  int min_val = mv;
  for (int i = 0; i < n; i++) {
    if (w[i][0] < min_val) {
      min_idx = i;
      min_val = w[i][0];
    }
  }
  cout << "YES" << endl;
  cout << k << endl;
  cout << w[0][0] - min_val;
  for (int i = 1; i < n; i++) cout << " " << w[i][0] - min_val;
  cout << endl;
  cout << w[min_idx][0];
  for (int j = 1; j < m; j++) cout << " " << w[min_idx][j];
  cout << endl;
  return 0;
}
