Problem: Let's define logical OR as an operation on two logical values (i. e. values that belong to the set {0, 1}) that is equal to 1 if either or both of the logical values is set to 1, otherwise it is 0. We can define logical OR of three or more logical values in the same manner:

<image> where <image> is equal to 1 if some ai = 1, otherwise it is equal to 0.

Nam has a matrix A consisting of m rows and n columns. The rows are numbered from 1 to m, columns are numbered from 1 to n. Element at row i (1 ≤ i ≤ m) and column j (1 ≤ j ≤ n) is denoted as Aij. All elements of A are either 0 or 1. From matrix A, Nam creates another matrix B of the same size using formula:

<image>.

(Bij is OR of all elements in row i and column j of matrix A)

Nam gives you matrix B and challenges you to guess matrix A. Although Nam is smart, he could probably make a mistake while calculating matrix B, since size of A can be large.

Input

The first line contains two integer m and n (1 ≤ m, n ≤ 100), number of rows and number of columns of matrices respectively.

The next m lines each contain n integers separated by spaces describing rows of matrix B (each element of B is either 0 or 1).

Output

In the first line, print "NO" if Nam has made a mistake when calculating B, otherwise print "YES". If the first line is "YES", then also print m rows consisting of n integers representing matrix A that can produce given matrix B. If there are several solutions print any one.

Examples

Input

2 2
1 0
0 0


Output

NO


Input

2 3
1 1 1
1 1 1


Output

YES
1 1 1
1 1 1


Input

2 3
0 1 0
1 1 1


Output

YES
0 0 0
0 1 0

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
ofstream fo("test.out");
ifstream fi("test.inp");
const long long MOD = 1e9 + 7;
const long long base = 269;
const int oo = 1 << 30;
const int N = 1e5 + 5;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
long long P(long long x, long long y) {
  long long ret = 1;
  while (y > 0) {
    if (y & 1) ret *= x;
    y /= 2;
    x = x * x;
  }
  return ret;
}
long long GCD(long long a, long long b) { return (b ? GCD(b, a % b) : a); }
int gi() {
  int w = 0;
  bool q = 1;
  char c = getchar();
  while ((c < '0' || c > '9') && c != '-') c = getchar();
  if (c == '-') q = 0, c = getchar();
  while (c >= '0' && c <= '9') w = w * 10 + c - '0', c = getchar();
  return q ? w : -w;
}
namespace io {
const int L = (1 << 21) + 1;
char ibuf[L], *iS, *iT, obuf[L], *oS = obuf, *oT = obuf + L - 1, c, st[55];
int f, tp;
inline char getc() {
  return (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, L, stdin),
                      (iS == iT ? EOF : *iS++))
                   : *iS++);
}
inline void flush() {
  fwrite(obuf, 1, oS - obuf, stdout);
  oS = obuf;
}
inline void putc(char x) {
  *oS++ = x;
  if (oS == oT) flush();
}
template <class I>
inline bool gi(I& x) {
  for (f = 1, c = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, L, stdin),
                              (iS == iT ? EOF : *iS++))
                            : *iS++);
       c < '0' || c > '9';
       c = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, L, stdin),
                       (iS == iT ? EOF : *iS++))
                     : *iS++))
    if (c == '-')
      f = -1;
    else if (c == -1)
      return false;
  for (x = 0; c <= '9' && c >= '0';
       c = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, L, stdin),
                       (iS == iT ? EOF : *iS++))
                     : *iS++))
    x = x * 10 + (c & 15);
  x *= f;
  return true;
}
template <class I>
inline void print(I x) {
  if (!x) putc('0');
  if (x < 0) putc('-'), x = -x;
  while (x) st[++tp] = x % 10 + '0', x /= 10;
  while (tp) putc(st[tp--]);
}
inline bool gs(char* s, int& l) {
  for (c = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, L, stdin),
                       (iS == iT ? EOF : *iS++))
                     : *iS++);
       c < 'a' || c > 'z';
       c = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, L, stdin),
                       (iS == iT ? EOF : *iS++))
                     : *iS++))
    if (c == -1) return false;
  for (l = 0; c <= 'z' && c >= 'a';
       c = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, L, stdin),
                       (iS == iT ? EOF : *iS++))
                     : *iS++))
    s[l++] = c;
  s[l] = 0;
  return true;
}
inline void printld(double x, int digit) {
  if (x < 0) putc('-'), x = -x;
  x += 0.5 * pow(0.1, digit);
  print((long long)x), putc('.');
  for (x -= (long long)x; digit; --digit)
    x = x * 10, putc((int)x + '0'), x -= (int)x;
}
inline void ps(const char* s) {
  for (int i = 0, n = strlen(s); i < n; i++) putc(s[i]);
}
struct IOFLUSHER {
  ~IOFLUSHER() { flush(); }
} _ioflusher_;
};  // namespace io
using io::getc;
using io::gi;
using io::gs;
using io::print;
using io::printld;
using io::ps;
using io::putc;
void inp_outp() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
void initPrime(long long p[], long long n) {
  p[0] = p[1] = -1;
  for (long long(i) = (2); (i) <= (n); (i)++) {
    if (!p[i]) {
      p[i] = i;
      long long j = 2;
      while (i * j <= n) {
        p[i * j] = i;
        j++;
      }
    }
  }
}
long long n, m, q, k, pos, rs;
long long a[105][105], b[105][105];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> m >> n;
  for (long long(i) = 0; (i) < (m); (i)++) {
    for (long long(j) = 0; (j) < (n); (j)++) {
      cin >> a[i][j];
    }
  }
  for (long long(i) = 0; (i) < (m); (i)++) {
    for (long long(j) = 0; (j) < (n); (j)++) {
      b[i][j] = 1;
    }
  }
  for (long long(i) = 0; (i) < (m); (i)++) {
    for (long long(j) = 0; (j) < (n); (j)++) {
      if (!a[i][j]) {
        for (long long(k) = 0; (k) < (n); (k)++) {
          b[i][k] = 0;
        }
        for (long long(k) = 0; (k) < (m); (k)++) b[k][j] = 0;
      }
    }
  }
  for (long long(i) = 0; (i) < (m); (i)++) {
    for (long long(j) = 0; (j) < (n); (j)++) {
      long long check = 0;
      if (a[i][j]) {
        for (long long(k) = 0; (k) < (n); (k)++) {
          if (b[i][k] || b[k][j]) check = 1;
        }
        if (!check) return cout << "NO", 0;
      }
    }
  }
  cout << "YES\n";
  for (long long(i) = 0; (i) < (m); (i)++) {
    for (long long(j) = 0; (j) < (n); (j)++) {
      cout << b[i][j] << " ";
    }
    cout << "\n";
  }
}