#include <bits/stdc++.h>
using namespace std;
int n, m;
int a[205][205], b[205][205];
int r[205], c[205];
bool check() {
  int i, j;
  for (i = 1; i <= m; i++) c[i] = a[1][i] ^ b[1][i];
  for (i = 2; i <= n; i++) {
    r[i] = a[i][1] ^ b[i][1] ^ c[1];
    for (j = 2; j <= m; j++)
      if ((r[i] ^ c[j]) != (a[i][j] ^ b[i][j])) return false;
  }
  return true;
}
int main() {
  int i, j;
  cin >> n >> m;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      cin >> a[i][j];
      b[i][j] = 1;
    }
  }
  int x = 1, y = 1;
  for (i = 0; i <= n * m; i++) {
    if (check()) {
      cout << "YES" << endl;
      for (i = 1; i <= n; i++) cout << r[i];
      cout << endl;
      for (i = 1; i <= m; i++) cout << c[i];
      cout << endl;
      return 0;
    }
    b[x][y] = 0;
    if (y == m)
      x++, y = 1;
    else
      y++;
  }
  cout << "NO" << endl;
  return 0;
}
