#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const long long mod = 1000000007;
const long long linf = 0x3f3f3f3f3f3f3f3f;
const long long N = 200100;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int mat[210][210];
int n, m;
int ansr[210];
int ansc[210];
bool check() {
  for (int i = 1; i < n * m; i++) {
    int x = (i - 1) / m + 1, y = (i - 1) % m + 1;
    int p = i / m + 1, q = i % m + 1;
    if (mat[x][y] > mat[p][q]) return false;
  }
  cout << "YES\n";
  for (int i = 1; i <= n; i++) cout << ansr[i];
  cout << "\n";
  for (int i = 1; i <= m; i++) cout << ansc[i];
  cout << "\n";
  return true;
}
void pri() {
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) cout << mat[i][j] << " ";
    cout << "\n";
  }
}
void solve() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) cin >> mat[i][j];
  }
  for (int j = 1; j <= m; j++) {
    if (mat[n][j]) {
      ansc[j] ^= 1;
      for (int i = 1; i <= n; i++) mat[i][j] ^= 1;
    }
  }
  if (check()) return;
  for (int i = 1; i < n; i++) {
    if (mat[i][m]) {
      ansr[i] ^= 1;
      for (int j = 1; j <= m; j++) mat[i][j] ^= 1;
    }
  }
  if (check()) return;
  ansc[m] ^= 1;
  for (int i = 1; i <= n; i++) mat[i][m] ^= 1;
  for (int i = 1; i < n; i++) {
    if (mat[i][m]) {
      ansr[i] ^= 1;
      for (int j = 1; j <= m; j++) mat[i][j] ^= 1;
    }
  }
  if (check()) return;
  for (int j = m - 1; j >= 1; j--) {
    if (!mat[n][j]) {
      ansc[j] ^= 1;
      for (int i = 1; i <= n; i++) mat[i][j] ^= 1;
    }
    if (check()) return;
  }
  for (int i = n - 1; i >= 1; i--) {
    if (!mat[i][m]) {
      ansr[i] ^= 1;
      for (int j = 1; j <= m; j++) mat[i][j] ^= 1;
    }
    if (check()) return;
  }
  cout << "NO\n";
}
int main() {
  cin.tie(0)->sync_with_stdio(0);
  ;
  solve();
  return 0;
}
