#include <bits/stdc++.h>
using namespace std;
int n, m;
int a[205][205];
int b[205][205];
int c[205], d[205];
bool solved(int x, int y) {
  memset(b, 0, sizeof(b));
  memset(c, 0, sizeof(c));
  memset(d, 0, sizeof(d));
  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;
  for (int i = 1; i <= n; i++) c[i] = a[i][1] ^ b[i][1] ^ d[1];
  for (int i = 1; i <= m; i++) d[i] = a[1][i] ^ b[1][i] ^ c[1];
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if ((c[i] ^ d[j]) != (a[i][j] ^ b[i][j])) return false;
  return true;
}
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 (solved(i, j)) {
        puts("YES");
        for (int i = 1; i <= n; i++) cout << c[i];
        cout << endl;
        for (int i = 1; i <= m; i++) cout << d[i];
        cout << endl;
        return 0;
      }
    }
  }
  puts("NO");
  return 0;
}
