#include <bits/stdc++.h>
using namespace std;
const int maxn = 1024;
const long long INF = 1e15 + 7;
int n, m;
int a[maxn][maxn];
void check() {
  for (int i = int(1); i <= int(n); ++i) {
    for (int j = int(1); j <= int(m); ++j) {
      if (!a[i][j]) continue;
      int flag1 = 1, flag2 = 1;
      for (int k = int(1); k <= int(n); ++k) flag1 &= a[k][j];
      for (int k = int(1); k <= int(m); ++k) flag2 &= a[i][k];
      if (!flag1 && !flag2) {
        printf("NO");
        exit(0);
      }
      bool checker = 0;
      if (flag1)
        for (int k = int(1); k <= int(n); ++k)
          checker |= (a[k][j - 1] & a[k][j + 1]);
      if (flag2)
        for (int k = int(1); k <= int(m); ++k)
          checker |= (a[i - 1][k] & a[i + 1][k]);
      if (!checker) {
        printf("NO");
        exit(0);
      }
    }
  }
  printf("YES\n");
}
int res[maxn][maxn];
int main() {
  scanf("%d %d", &n, &m);
  for (int i = int(1); i <= int(max(n, m)); ++i) a[i][0] = a[0][i] = 1;
  for (int i = int(1); i <= int(n); ++i) a[i][m + 1] = 1;
  for (int i = int(1); i <= int(m); ++i) a[n + 1][i] = 1;
  for (int i = int(1); i <= int(n); ++i) {
    for (int j = int(1); j <= int(m); ++j) {
      scanf("%d", &a[i][j]);
    }
  }
  check();
  for (int i = int(1); i <= int(n); ++i) {
    for (int j = int(1); j <= int(m); ++j) {
      if (!a[i][j]) continue;
      bool checker = 1;
      for (int k = int(1); k <= int(n); ++k) checker &= a[k][j];
      for (int k = int(1); k <= int(m); ++k) checker &= a[i][k];
      res[i][j] = checker;
    }
  }
  for (int i = int(1); i <= int(n); ++i) {
    for (int j = int(1); j <= int(m); ++j) printf("%d ", res[i][j]);
    putchar('\n');
  }
  return 0;
}
