#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, n;
  cin >> m >> n;
  int b[m][n], a[m][n];
  for (int i = 0; i < m; i++)
    for (int j = 0; j < n; j++) {
      cin >> b[i][j];
      a[i][j] = 1;
    }
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < n; j++) {
      if (b[i][j] == 0) {
        for (int k = 0; k < m; k++) a[k][j] = 0;
        for (int k = 0; k < n; k++) a[i][k] = 0;
      }
    }
  }
  int g[m], h[n];
  for (int i = 0; i < m; i++) {
    g[i] = a[i][0];
    for (int j = 1; j < n; j++) g[i] = g[i] | a[i][j];
  }
  for (int i = 0; i < n; i++) {
    h[i] = a[0][i];
    for (int j = 1; j < m; j++) h[i] = h[i] | a[j][i];
  }
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < n; j++) {
      if (b[i][j] != (g[i] | h[j])) {
        cout << "NO";
        return 0;
      }
    }
  }
  cout << "YES\n";
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < n; j++) {
      cout << a[i][j] << " ";
    }
    cout << endl;
  }
  return 0;
}
