#include <bits/stdc++.h>
#pragma GCC optimize(2)
#pragma GCC optimize(3)
using namespace std;
int N, M;
int a[205][205], b[205][205];
int r[205], c[205];
bool work(int x, int y) {
  memset(r, 0, sizeof(r));
  memset(c, 0, sizeof(c));
  memset(b, 0, sizeof(b));
  for (int i = x; i <= N; i++) {
    for (int j = 1; j <= M; j++) {
      if (i == x && j < y)
        b[i][j] = 0;
      else
        b[i][j] = 1;
    }
  }
  r[1] = a[1][1] ^ b[1][1];
  for (int j = 1; j <= M; j++) c[j] = a[1][j] ^ b[1][j] ^ r[1];
  for (int i = 1; i <= N; i++) {
    for (int j = 1; j <= M; j++) {
      if (i == 1 && j == 1) continue;
      if (j == 1) {
        r[i] = a[i][j] ^ b[i][j] ^ c[1];
        continue;
      }
      if (c[j] != a[i][j] ^ b[i][j] ^ r[i]) return 0;
    }
  }
  return 1;
}
int main() {
  cin >> N >> M;
  for (int i = 1; i <= N; i++) {
    for (int j = 1; j <= M; j++) cin >> a[i][j];
  }
  for (int i = 1; i <= N; i++) {
    for (int j = 1; j <= M; j++) {
      if (work(i, j)) {
        cout << "YES" << endl;
        for (int i = 1; i <= N; i++) cout << r[i];
        cout << endl;
        for (int j = 1; j <= M; j++) cout << c[j];
        cout << endl;
        return 0;
      }
    }
  }
  cout << "NO" << endl;
  return 0;
}
