#include <bits/stdc++.h>
using namespace std;
unordered_set<int> s;
int main() {
  int m, n;
  cin >> m >> n;
  vector<vector<int> > b(m, vector<int>(n, 0));
  vector<vector<int> > a(m, vector<int>(n, 0));
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < n; j++) {
      cin >> b[i][j];
      if (b[i][j] == 0) s.insert(j);
    }
  }
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < n; j++) {
      if (b[i][j] == 1) {
        if (find(b[i].begin(), b[i].end(), 0) != b[i].end()) {
          for (int k = 0; k < m; k++) {
            if (b[k][j] == 0) {
              cout << "NO\n";
              return 0;
            }
          }
          int f = 0;
          for (int k = 0; k < m; k++) {
            if (find(b[k].begin(), b[k].end(), 0) == b[k].end()) {
              f = 1;
              break;
            }
          }
          if (f == 0) {
            cout << "NO\n";
            return 0;
          }
        } else {
          int f = 0;
          for (int k = 0; k < n; ++k) {
            if (s.find(k) == s.end()) {
              f = 1;
              break;
            }
          }
          if (f == 0) {
            cout << "NO\n";
            return 0;
          }
          f = 0;
          for (int k = 0; k < m; k++) {
            if (b[k][j] == 0) {
              f = 1;
              break;
            }
          }
          if (f == 0) a[i][j] = 1;
        }
      }
    }
  }
  cout << "YES\n";
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < n; j++) {
      cout << a[i][j] << ' ';
    }
    cout << '\n';
  }
  return 0;
}
