#include <bits/stdc++.h>
using namespace std;
int n, m, a[300][300], BitPos[300][300], DoA[300], DoB[300];
bool Check(int x, int y) {
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (i < x || (i == x && j < y))
        BitPos[i][j] = 0;
      else
        BitPos[i][j] = 1;
    }
  }
  DoA[1] = a[1][1] ^ BitPos[1][1];
  for (int i = 1; i <= m; i++) DoB[i] = a[1][i] ^ BitPos[1][i] ^ DoA[1];
  for (int i = 2; i <= n; i++) {
    DoA[i] = a[i][1] ^ BitPos[i][1] ^ DoB[1];
    for (int j = 2; j <= m; j++)
      if (BitPos[i][j] != (a[i][j] ^ DoA[i] ^ DoB[j])) return 0;
  }
  return 1;
  return true;
}
void Print() {
  puts("YES");
  for (int i = 1; i <= n; i++) cout << DoA[i];
  puts("");
  for (int i = 1; i <= m; i++) cout << DoB[i];
  puts("");
  exit(0);
}
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) cin >> a[i][j], BitPos[i][j] = 1;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (Check(i, j)) Print();
  ;
  ;
  ;
  ;
  ;
  ;
  puts("NO");
  ;
  ;
  ;
  ;
  ;
  ;
  return 0;
}
