#include <bits/stdc++.h>
using namespace std;
int dr[] = {+1, -1, +0, +0};
int dc[] = {+0, +0, +1, -1};
long long gcd(long long n, long long m) { return m ? gcd(m, n % m) : n; }
long long lcm(long long n, long long m) { return n / gcd(n, m) * m; }
struct debugger {
  static void call(string::iterator it, string::iterator ed) {}
  template <typename T, typename... aT>
  static void call(string::iterator it, string::iterator ed, T a, aT... rest) {
    string b;
    for (; *it != ','; ++it)
      if (*it != ' ') b += *it;
    cout << b << "=" << a << " ";
    call(++it, ed, rest...);
  }
};
void solve() {
  int m, n;
  scanf("%d %d", &m, &n);
  ;
  int mat[m + 10][n + 10], ans[m + 10][n + 10], trans[m + 10][n + 10];
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < n; j++) {
      cin >> mat[i][j];
      ans[i][j] = 1;
      trans[i][j] = 0;
    }
  }
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < n; j++) {
      if (mat[i][j] == 0) {
        for (int k = 0; k < n; k++) {
          ans[i][k] = 0;
        }
        for (int k = 0; k < m; k++) {
          ans[k][j] = 0;
        }
      }
    }
  }
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < n; j++) {
      for (int k = 0; k < n; k++) {
        trans[i][j] = max(trans[i][j], ans[i][k]);
      }
      for (int k = 0; k < m; k++) {
        trans[i][j] = max(trans[i][j], ans[k][j]);
      }
      if (mat[i][j] != trans[i][j]) {
        cout << "NO\n";
        return;
      }
    }
  }
  cout << "YES\n";
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < n; j++) {
      cout << ans[i][j] << " ";
    }
    cout << "\n";
  }
}
int main() {
  solve();
  return 0;
}
