#include <bits/stdc++.h>
using namespace std;
const int MAXN = 205;
const int INF = (long long)1e9 + 5;
const long long MOD = 998244353;
int R, C, a[MAXN][MAXN], row[MAXN], col[MAXN], diff[MAXN];
void get_diff() {
  for (int i = 0; i < R; i++) {
    diff[i] = 0;
    for (int j = 0; j < C - 1; j++) {
      if (a[i][j] ^ col[j] != a[i][j + 1] ^ col[j + 1]) {
        diff[i]++;
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> R >> C;
  for (int i = 0; i < R; i++) {
    for (int j = 0; j < C; j++) {
      int x;
      cin >> x;
      a[i][j] = x;
    }
  }
  bool ok = false;
  for (int c = 0; c <= C && !ok; c++) {
    for (int j = 0; j < C; j++) {
      col[j] = a[0][j] ^ (j >= c);
    }
    get_diff();
    int tot = 0;
    for (int k = 0; k < R; k++) {
      tot += diff[k];
    }
    if (tot > 1) continue;
    ok = true;
    bool occ = false;
    for (int i = 0; i < R; i++) {
      if (diff[i] == 1 || !occ) {
        row[i] = a[i][0] ^ col[0];
      } else {
        row[i] = a[i][0] ^ col[0] ^ 1;
      }
      occ = occ || diff[i] == 1;
    }
  }
  if (ok) {
    cout << "YES\n";
    for (int i = 0; i < R; i++) cout << row[i];
    cout << '\n';
    for (int i = 0; i < C; i++) cout << col[i];
    cout << '\n';
  } else {
    cout << "NO\n";
  }
  return 0;
}
