#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
const int MAXH = 200;
const int MAXW = 200;
int h, w;
int a[MAXH][MAXW];
bool invcol[MAXW];
bool invrow[MAXH];
int b[MAXH][MAXW];
bool solveb() {
  int diffrow = -1;
  for (int x = (0); x < (h); ++x) {
    bool allsame = true;
    for (int y = (1); y < (w); ++y)
      if (b[x][y] != b[x][0]) allsame = false;
    if (allsame) continue;
    if (diffrow == -1)
      diffrow = x;
    else
      diffrow = -2;
  }
  if (diffrow == -2) return false;
  if (diffrow == -1) {
    for (int x = (0); x < (h); ++x) invrow[x] = b[x][0] == 1;
  } else {
    for (int x = (0); x < (h); ++x)
      invrow[x] = x <= diffrow ? b[x][0] == 1 : b[x][0] == 0;
  }
  return true;
}
bool solve() {
  invcol[0] = false;
  for (int y = (1); y < (w); ++y) invcol[y] = (a[0][y] != a[0][0]);
  for (int x = (0); x < (h); ++x)
    for (int y = (0); y < (w); ++y) {
      b[x][y] = a[x][y];
      if (invcol[y]) b[x][y] = 1 - b[x][y];
    }
  for (int y = (1); y < (w); ++y) assert(b[0][y] == b[0][0]);
  if (solveb()) return true;
  assert(h >= 2);
  invcol[0] = false;
  for (int y = (1); y < (w); ++y) invcol[y] = (a[1][y] != a[1][0]);
  for (int x = (0); x < (h); ++x)
    for (int y = (0); y < (w); ++y) {
      b[x][y] = a[x][y];
      if (invcol[y]) b[x][y] = 1 - b[x][y];
    }
  for (int y = (1); y < (w); ++y) assert(b[1][y] == b[1][0]);
  if (solveb()) return true;
  return false;
}
void run() {
  scanf("%d%d", &h, &w);
  for (int x = (0); x < (h); ++x)
    for (int y = (0); y < (w); ++y) scanf("%d", &a[x][y]);
  if (!solve()) {
    printf("NO\n");
    return;
  }
  printf("YES\n");
  for (int x = (0); x < (h); ++x) printf("%c", invrow[x] ? '1' : '0');
  puts("");
  for (int y = (0); y < (w); ++y) printf("%c", invcol[y] ? '1' : '0');
  puts("");
}
int main() {
  run();
  return 0;
}
