#include <bits/stdc++.h>
using namespace std;
void zaza(int war, int x, int y);
void zazc(int war, int x, int y);
int n, m, k;
int a[1009][1009], b[1009][1009], c[1009][1009];
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      scanf("%d", &b[i][j]);
      if (!b[i][j]) zaza(-1, i, j);
    }
  }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (a[i][j] + 1) zazc(1, i, j);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (b[i][j] != c[i][j]) {
        printf("NO\n");
        return 0;
      }
  printf("YES\n");
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      printf("%d ", a[i][j] + 1);
    }
    printf("\n");
  }
}
void zaza(int war, int x, int y) {
  for (int i = 0; i < n; i++) a[i][y] = war;
  for (int i = 0; i < m; i++) a[x][i] = war;
}
void zazc(int war, int x, int y) {
  for (int i = 0; i < n; i++) c[i][y] = war;
  for (int i = 0; i < m; i++) c[x][i] = war;
}
