#include <bits/stdc++.h>
using namespace std;
const long double eps = 1e-13;
const long double PI = acos(-1);
const int INF = (int)1e9 + 7;
const long long INFF = (long long)1e18;
const int mod = 998244353;
const int MXN = (int)2e2 + 7;
int a[MXN][MXN];
int b[MXN][MXN];
char rr[MXN], cc[MXN];
void sol(int n, int m, int p) {
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) b[i][j] = a[i][j];
  for (int i = 1; i <= n; i++) rr[i] = '0';
  for (int j = 1; j <= m; j++) cc[j] = '0';
  for (int i = 1; i <= m; i++) {
    if (b[1][i] == 1 && i < p) {
      for (int j = 1; j <= n; j++) b[j][i] ^= 1;
      cc[i] = '1';
    } else if (b[1][i] == 0 && i >= p) {
      for (int j = 1; j <= n; j++) b[j][i] ^= 1;
      cc[i] = '1';
    }
  }
  bool op = (p == m + 1 ? true : false);
  for (int i = 2; i <= n; i++) {
    int cnt = 0;
    for (int j = 1; j <= m; j++) cnt += b[i][j];
    if (cnt == 0) {
      if (op) {
      } else {
        rr[i] = '1';
      }
    } else if (cnt == m) {
      if (op) {
        rr[i] = '1';
      } else {
      }
    } else {
      if (op) {
        int num = 0, num2 = 0;
        for (int j = 1; j <= cnt; j++) num += b[i][j];
        for (int j = 1; j <= m - cnt; j++) num2 += b[i][j];
        if (num == cnt) {
          rr[i] = '1';
        } else if (!num2) {
        } else {
          return;
        }
        op = false;
      } else {
        return;
      }
    }
  }
  puts("YES");
  printf("%s\n%s\n", rr + 1, cc + 1);
  exit(0);
}
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) scanf("%d", a[i] + j);
  for (int i = 1; i <= m + 1; i++) sol(n, m, i);
  puts("NO");
  return 0;
}
