#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
long long n, m;
vector<vector<long long>> a(222, vector<long long>(222));
void solve(long long h, long long w) {
  vector<long long> H(n), W(m);
  for (long long i = (0); i < (h); i++) {
    for (long long j = (0); j < (m); j++) {
      if (a[h][0] ^ a[h][j] ^ (j > w) != a[i][0] ^ a[i][j]) return;
    }
  }
  for (long long i = (h + 1); i < (n); i++) {
    for (long long j = (0); j < (m); j++) {
      if (a[h][0] ^ a[h][j] ^ (j > w) != a[i][0] ^ a[i][j]) return;
    }
  }
  cout << "YES" << endl;
  for (long long i = (0); i < (m); i++) {
    if (a[h][i] ^ (i > w)) {
      W[i] = 1;
      for (long long j = (0); j < (n); j++) {
        a[j][i] ^= 1;
      }
    } else
      W[i] = 0;
  }
  for (long long i = (0); i < (n); i++) {
    if (a[i][0] ^ (i > h))
      H[i] = 1;
    else
      H[i] = 0;
  }
  for (long long i = (0); i < (n); i++) cout << H[i];
  cout << endl;
  for (long long i = (0); i < (m); i++) cout << W[i];
  cout << endl;
  exit(0);
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m;
  for (long long i = (0); i < (n); i++)
    for (long long j = (0); j < (m); j++) cin >> a[i][j];
  for (long long i = (0); i < (n); i++)
    for (long long j = (0); j < (m); j++) solve(i, j);
  cout << "NO" << endl;
  return 0;
}
