#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long n, m;
  cin >> n >> m;
  long long a[n][m];
  vector<long long> r(n);
  vector<long long> c(m);
  for (long long i = 0; i < n; i++)
    for (long long j = 0; j < m; j++) {
      cin >> a[i][j];
      if (a[i][j]) {
        r[i]++;
        c[j]++;
      }
    }
  long long b[n][m];
  vector<bool> vi(n);
  vector<bool> vj(m);
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      if (a[i][j] == 0) {
        b[i][j] = 0;
        continue;
      }
      if (r[i] == m and c[j] == n) {
        b[i][j] = 1;
        vi[i] = 1;
        vj[j] = 1;
      }
    }
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      if (a[i][j] == 1) {
        if (r[i] == m and c[j] == n) continue;
        if (vi[i] or vj[j])
          b[i][j] = 0;
        else {
          puts("NO");
          return 0;
        }
      }
    }
  }
  puts("YES");
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      cout << b[i][j] << " ";
    }
    cout << "\n";
  }
}
