#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, n;
  cin >> m >> n;
  int b[m][n], a[m][n], c[m][n];
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < n; j++) {
      a[i][j] = 1;
    }
  }
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < n; j++) {
      c[i][j] = 0;
    }
  }
  long long int x = 0, y = 0;
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < n; j++) {
      cin >> b[i][j];
    }
  }
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < n; j++) {
      if (b[i][j] == 0) {
        for (int k = 0; k < n; k++) {
          a[i][k] = 0;
        }
        for (int l = 0; l < m; l++) {
          a[l][j] = 0;
        }
      }
    }
  }
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < n; j++) {
      x = 0;
      y = 0;
      for (int k = 0; k < n; k++) {
        x = x | a[i][k];
      }
      for (int l = 0; l < m; l++) {
        y = y | a[l][j];
      }
      c[i][j] = x | y;
    }
  }
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < n; j++) {
      if (c[i][j] != b[i][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 << "\n";
  }
  return 0;
}
