#include <bits/stdc++.h>
using namespace std;
const int maxn = 250;
int matrix[maxn][maxn], n, m, change_r[maxn], change_c[maxn], aim[maxn][maxn];
void init() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      scanf("%d", &matrix[i][j]);
    }
  }
}
bool change(int x, int y) {
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      aim[i][j] = (i * m + j >= x * m + y);
    }
  }
  change_r[1] = aim[1][1] ^ matrix[1][1];
  for (int i = 1; i <= m; i++) {
    change_c[i] = aim[1][i] ^ matrix[1][i] ^ change_r[1];
  }
  for (int i = 2; i <= n; i++) {
    change_r[i] = aim[i][1] ^ matrix[i][1] ^ change_c[1];
    for (int j = 1; j <= m; j++) {
      if (aim[i][j] != (matrix[i][j] ^ change_r[i] ^ change_c[j])) return false;
    }
  }
  return true;
}
int main() {
  init();
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      bool ans = change(i, j);
      if (ans) {
        puts("YES");
        for (int i = 1; i <= n; i++) {
          printf("%d", change_r[i]);
        }
        printf("\n");
        for (int i = 1; i <= m; i++) {
          printf("%d", change_c[i]);
        }
        return 0;
      }
    }
  }
  puts("NO");
  return 0;
}
