#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n, m, flag = 0;
  cin >> n >> m;
  long long int a[n][m];
  long long int b[n][m];
  long long int c[n][m];
  for (long long int i = 0; i < n; i++) {
    for (long long int j = 0; j < m; j++) {
      cin >> b[i][j];
      a[i][j] = 1;
      c[i][j] = 0;
    }
  }
  for (long long int i = 0; i < n; i++) {
    for (long long int j = 0; j < m; j++) {
      if (b[i][j] == 0) {
        long long int k = 0;
        while (k < m) {
          a[i][k] = 0;
          k++;
        }
        k = 0;
        while (k < n) {
          a[k][j] = 0;
          k++;
        }
      }
    }
  }
  for (long long int i = 0; i < n; i++) {
    for (long long int j = 0; j < m; j++) {
      long long int k = 0;
      while (k < m) {
        c[i][j] = c[i][j] | a[i][k];
        k++;
      }
      k = 0;
      while (k < n) {
        c[i][j] = c[i][j] | a[k][j];
        k++;
      }
    }
  }
  for (long long int i = 0; i < n; i++) {
    for (long long int j = 0; j < m; j++) {
      if (b[i][j] != c[i][j]) {
        flag = 1;
        break;
      }
      if (flag == 1) break;
    }
  }
  if (flag == 0) {
    cout << "YES"
         << "\n";
    for (long long int i = 0; i < n; i++) {
      for (long long int j = 0; j < m; j++) cout << a[i][j] << " ";
      cout << "\n";
    }
  } else
    cout << "NO"
         << "\n";
}
int32_t main() { solve(); }
