#include <bits/stdc++.h>
using namespace std;
const int N = 201;
long long op;
int n, m, a[N][N], rep[4 * N + 1], odw[4 * N + 1], nr;
int val[4 * N + 1];
bool res[N][N], unsat;
vector<int> v[4 * N + 1], comp[4 * N + 1];
int opposite(int x) {
  if (x < n) return x + n;
  if (x < 2 * n) return x - n;
  if (x < 2 * n + m) return x + m;
  return x - m;
}
void bfs(int x) {
  queue<int> q;
  q.push(x);
  rep[x] = nr;
  comp[nr].push_back(x);
  odw[x] = 1;
  while (q.size()) {
    int y = q.front();
    q.pop();
    for (int i : v[y]) {
      op++;
      if (!odw[i]) {
        odw[i] = 1;
        q.push(i);
        rep[i] = nr;
        comp[nr].push_back(i);
        if (rep[i] == rep[opposite(i)]) {
          unsat = 1;
          return;
        }
      }
    }
  }
}
bool two_sat() {
  for (int i = 0; i < 2 * n + 2 * m; ++i) {
    val[i] = -1;
    odw[i] = 0;
    rep[i] = -1;
    comp[i].clear();
  }
  nr = 0;
  unsat = 0;
  for (int i = 0; i < 2 * n + 2 * m; ++i) {
    if (!odw[i]) {
      bfs(i);
      if (unsat) return false;
      nr++;
    }
  }
  for (int i = 0; i < nr; ++i) {
    bool set_to = 0;
    for (int j : comp[i]) {
      if (val[j] == 1 || val[opposite(j)] == 0) {
        set_to = 1;
      }
    }
    for (int j : comp[i]) {
      val[j] = set_to;
    }
  }
  return true;
}
void output() {
  for (int i = 0; i < n; ++i) {
    cout << val[i];
  }
  cout << "\n";
  for (int i = 0; i < m; ++i) {
    cout << val[2 * n + i];
  }
}
void del(int x, int y) {
  for (int i = 0; i < (int)v[x].size(); ++i) {
    if (v[x][i] == y) {
      swap(v[x][i], v[x].back());
      v[x].pop_back();
    }
  }
  if (x < y) {
    del(y, x);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      cin >> a[i][j];
      res[i][j] = 1;
    }
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (a[i][j] == res[i][j]) {
        v[i].push_back(2 * n + j);
        v[2 * n + m + j].push_back(n + i);
        v[n + i].push_back(2 * n + m + j);
        v[2 * n + j].push_back(i);
      } else {
        v[n + i].push_back(2 * n + j);
        v[2 * n + m + j].push_back(i);
        v[i].push_back(2 * n + m + j);
        v[2 * n + j].push_back(n + i);
      }
    }
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (two_sat()) {
        cout << "YES\n";
        output();
        return 0;
      }
      res[i][j] = 0;
      del(i, 2 * n + j);
      del(i, 2 * n + m + j);
      del(n + i, 2 * n + j);
      del(n + i, 2 * n + m + j);
      if (a[i][j] == res[i][j]) {
        v[i].push_back(2 * n + j);
        v[2 * n + m + j].push_back(n + i);
        v[n + i].push_back(2 * n + m + j);
        v[2 * n + j].push_back(i);
      } else {
        v[n + i].push_back(2 * n + j);
        v[2 * n + m + j].push_back(i);
        v[i].push_back(2 * n + m + j);
        v[2 * n + j].push_back(n + i);
      }
    }
  }
  if (two_sat()) {
    cout << "YES\n";
    output();
    return 0;
  }
  cout << "NO";
}
