#include <bits/stdc++.h>
using namespace std;
const int MX = 205;
int a[MX][MX];
int x[MX];
int y[MX];
int n, m;
void Check() {
  int pr = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      int c = (a[i][j] ^ y[i] ^ x[j]);
      if (c < pr) return;
      pr = c;
    }
  }
  printf("YES\n");
  for (int i = 0; i < n; i++) printf("%d", y[i]);
  printf("\n");
  for (int j = 0; j < m; j++) printf("%d", x[j]);
  printf("\n");
  exit(0);
}
int main() {
  ignore = scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      ignore = scanf("%d", &a[i][j]);
    }
  }
  for (int c = 0; c <= m; c++) {
    for (int j = 0; j < m; j++) {
      x[j] = y[0] ^ a[0][j] ^ (j >= c);
    }
    for (int i = 1; i < n; i++) {
      y[i] = x[0] ^ a[i][0] ^ 1;
    }
    Check();
  }
  for (int c = 1; c <= n; c++) {
    for (int j = 0; j < m; j++) {
      x[j] = y[0] ^ a[0][j];
    }
    for (int i = 1; i < n; i++) {
      y[i] = x[0] ^ a[i][0] ^ (i >= c);
    }
    Check();
  }
  printf("NO\n");
}
