#include <bits/stdc++.h>
using namespace std;
int inp[105][105];
int a[105];
int b[105];
int temp[105];
int main() {
  int n, m;
  scanf("%d", &n);
  scanf("%d", &m);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) scanf("%d", &inp[i][j]);
  for (int i = 0; i < m; i++) b[i] = inp[0][i];
  int up = 0;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) up = max(up, inp[i][j]);
  int prevk = 0;
  for (int i = 1; i <= n - 1; i++) {
    map<int, int> mp;
    for (int j = 0; j < m; j++) {
      temp[j] = inp[i][j] - b[j];
      mp[temp[j]] = 1;
    }
    int currk = 0;
    if (mp.size() == 2) {
      int f = mp.rbegin()->first;
      int s = mp.begin()->first;
      if (max(f, s) >= 0 && min(f, s) <= 0)
        currk = max(s, f) - min(s, f);
      else
        currk = -1;
    }
    if (mp.size() > 2 || (currk && prevk && currk != prevk) ||
        (currk != 0 && currk <= up)) {
      printf("NO\n");
      return 0;
    }
    prevk = max(prevk, currk);
    a[i] = max(mp.rbegin()->first, mp.begin()->first);
  }
  printf("YES\n");
  if (prevk == 0) prevk = 2e9 + 7;
  printf("%d\n", prevk);
  for (int i = 0; i < n; i++)
    printf("%d ", (a[i] >= 0) ? a[i] : (a[i] + prevk));
  cout << endl;
  for (int i = 0; i < m; i++) printf("%d ", b[i]);
  cout << endl;
  return 0;
}
