#include <bits/stdc++.h>
using namespace std;
long long power(long long base, long long exp) {
  long long res = 1;
  while (exp > 0) {
    if (exp % 2 == 1) res = (res * base);
    base = (base * base);
    exp /= 2;
  }
  return res;
}
struct ele {
  long long a, b;
  ele() { b = 0; }
};
bool comp(ele &a, ele &b) { return a.b > b.b; }
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
void solve() {
  int m, n;
  cin >> m >> n;
  int b[m + 1][n + 1];
  int a[m + 1][n + 1];
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= n; j++) {
      cin >> b[i][j];
      a[i][j] = 1;
    }
  }
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= n; j++) {
      if (b[i][j] == 0) {
        for (int k = 1; k <= n; k++) a[i][k] = 0;
        for (int k = 1; k <= m; k++) a[k][j] = 0;
      }
    }
  }
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= n; j++) {
      if (b[i][j] == 1) {
        bool flag = false;
        for (int k = 1; k <= n; k++) {
          if (a[i][k] == 1) flag = true;
        }
        for (int k = 1; k <= m; k++) {
          if (a[k][j] == 1) flag = true;
        }
        if (!flag) {
          cout << "NO\n";
          return;
        }
      }
    }
  }
  cout << "YES\n";
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= n; j++) cout << a[i][j] << " ";
    cout << endl;
  }
}
int main() {
  long long t = 1;
  for (long long i = 1; i <= t; i++) solve();
}
