#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  cin >> n >> m;
  long long mat[n][m];
  long long new_mat[n][m];
  vector<long long> rows;
  vector<long long> cols;
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      cin >> mat[i][j];
      new_mat[i][j] = mat[i][j];
      if (mat[i][j] == 0) {
        rows.push_back(i);
        cols.push_back(j);
      }
    }
  }
  for (long long i = 0; i < rows.size(); i++) {
    long long temp = rows[i];
    for (long long j = 0; j < m; j++) {
      new_mat[temp][j] = 0;
    }
  }
  for (long long i = 0; i < cols.size(); i++) {
    long long temp = cols[i];
    for (long long i = 0; i < n; i++) {
      new_mat[i][temp] = 0;
    }
  }
  vector<long long> rows_1;
  vector<long long> cols_1;
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      if (new_mat[i][j] == 1) {
        rows_1.push_back(i);
        cols_1.push_back(j);
      }
    }
  }
  long long new_mat_1[n][m];
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      new_mat_1[i][j] = new_mat[i][j];
    }
  }
  bool check = true;
  for (long long i = 0; i < rows_1.size(); i++) {
    long long temp = rows_1[i];
    for (long long j = 0; j < m; j++) {
      new_mat_1[temp][j] = 1;
    }
  }
  for (long long i = 0; i < cols_1.size(); i++) {
    long long temp = cols_1[i];
    for (long long j = 0; j < n; j++) {
      new_mat_1[j][temp] = 1;
    }
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      if (new_mat_1[i][j] != mat[i][j]) {
        check = false;
        break;
      }
    }
    if (check == false) break;
  }
  if (check) {
    cout << "YES" << endl;
    for (long long i = 0; i < n; i++) {
      for (long long j = 0; j < m; j++) {
        cout << new_mat[i][j] << " ";
      }
      cout << '\n';
    }
  } else {
    cout << "NO" << endl;
  }
}
