#include <bits/stdc++.h>
using namespace std;
const int MAXN = 210;
int v[MAXN][MAXN];
int m[MAXN][MAXN];
bool col[MAXN];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cin >> v[i][j];
    }
  }
  for (int i = 1; i <= m; i++) {
    if (v[1][i] == 1) continue;
    col[i] = true;
    for (int j = 1; j <= n; j++) {
      v[j][i] += 1, v[j][i] %= 2;
    }
  }
  for (int i = 1; i <= m; i++) {
    if (col[i] == true)
      col[i] = false;
    else if (col[i] == false)
      col[i] = true;
    int l = 0;
    int p[MAXN];
    memset(p, -1, sizeof p);
    for (int j = 1; j <= n; j++) {
      v[j][i] += 1;
      v[j][i] %= 2;
    }
    for (int j = 1; j <= n; j++) {
      for (int k = 1; k < m; k++) {
        if (v[j][k] != v[j][k + 1]) l++;
      }
    }
    if (l <= 1) {
      cout << "YES" << endl;
      bool f = false;
      for (int j = 1; j <= n; j++) {
        set<int> s;
        for (int k = 1; k <= m; k++) {
          s.insert(v[j][k]);
        }
        if (f == false) {
          if (v[j][1] == 0)
            cout << 0;
          else
            cout << 1;
        }
        if (f == true) {
          if (v[j][1] == 1)
            cout << 0;
          else
            cout << 1;
        }
        if (s.size() == 2) f = true;
      }
      cout << endl;
      for (int j = 1; j <= m; j++) {
        if (col[j] == true)
          cout << 1;
        else
          cout << 0;
      }
      return 0;
    }
  }
  cout << "NO" << endl;
}
