#include <bits/stdc++.h>
const int maxn = 100;
long q, n, m, w[maxn][maxn], a[maxn], b[maxn], e[maxn][maxn], g;
int p, p1, p2;
int gcd(int a, int b) {
  if (a < 0) a *= -1;
  if (b < 0) b *= -1;
  if (a > b) {
    int p = a;
    a = b;
    b = p;
  }
  if (a == 0) return b;
  return gcd(b % a, a);
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) scanf("%d", &w[i][j]);
  g = w[0][0];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (g < w[i][j]) g = w[i][j];
  g++;
  for (int i = 0; i < n; i++) a[i] = w[i][0] - w[0][0];
  for (int i = 0; i < m; i++) b[i] = w[0][i];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) e[i][j] = a[i] + b[j];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) e[i][j] -= w[i][j];
  p = 0;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (e[i][j] == 0)
        p++;
      else
        q = e[i][j];
  p2 = p;
  if (p2 == n * m) {
    p = 0;
    while (p == 0) {
      p1 = 0;
      for (int i = 0; i < n; i++)
        if (a[i] > 0) p1++;
      if (p1 == n) {
        p = 1;
        continue;
      }
      for (int i = 0; i < n; i++) a[i] += g;
    }
    p = 0;
    while (p == 0) {
      p1 = 0;
      for (int i = 0; i < m; i++)
        if (b[i] > 0) p1++;
      if (p1 == m) {
        p = 1;
        continue;
      }
      for (int i = 0; i < m; i++) b[i] += g;
    }
  }
  if (p2 == n * m) {
    printf("YES\n");
    printf("%ld\n", g);
    for (int i = 0; i < n; i++) printf("%ld ", a[i]);
    printf("\n");
    for (int i = 0; i < m; i++) printf("%ld ", b[i]);
    return 0;
  }
  g = q;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (e[i][j] != 0) g = gcd(g, e[i][j]);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (g <= w[i][j]) {
        printf("NO");
        return 0;
      }
  p = 0;
  while (p == 0) {
    p1 = 0;
    for (int i = 0; i < n; i++)
      if (a[i] >= 0) p1++;
    if (p1 == n) {
      p = 1;
      continue;
    }
    for (int i = 0; i < n; i++) {
      a[i] += g;
    }
  }
  p = 0;
  while (p == 0) {
    p1 = 0;
    for (int i = 0; i < m; i++)
      if (b[i] >= 0) p1++;
    if (p1 == m) {
      p = 1;
      continue;
    }
    for (int i = 0; i < m; i++) b[i] += g;
  }
  printf("YES\n");
  printf("%ld\n", g);
  for (int i = 0; i < n; i++) printf("%ld ", a[i]);
  printf("\n");
  for (int i = 0; i < m; i++) printf("%ld ", b[i]);
  return 0;
}
