#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  bool A[n][m], B[n][m];
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      cin >> B[i][j];
    }
  }
  memset(A, 1, sizeof(A));
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (!B[i][j]) {
        for (int k = 0; k < m; ++k) A[i][k] = 0;
        for (int k = 0; k < n; ++k) A[k][j] = 0;
      }
    }
  }
  bool C[n][m], row[n], col[m];
  memset(row, 0, sizeof(row));
  memset(col, 0, sizeof(col));
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (!j)
        row[i] = A[i][j];
      else
        row[i] = row[i] || A[i][j] || A[i][j - 1];
    }
  }
  for (int j = 0; j < m; ++j) {
    for (int i = 0; i < n; ++i) {
      if (!i)
        col[j] = A[i][j];
      else
        col[j] = col[j] || A[i][j] || A[i - 1][j];
    }
  }
  bool ok = 1;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      C[i][j] = (row[i] or col[j]);
      if (C[i][j] != B[i][j]) ok = 0;
    }
  }
  if (!ok)
    cout << "NO" << endl;
  else {
    cout << "YES" << endl;
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < m; ++j) {
        cout << A[i][j] << " ";
      }
      cout << endl;
    }
  }
}
