#include <bits/stdc++.h>
using namespace std;
int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch - '0' < 0 || ch - '0' > 9) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch - '0' >= 0 && ch - '0' <= 9) {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int n, m;
int a[205][205], b[205][205];
int ans_line[205], ans_row[205];
void rev_line(int x) {
  for (int i = 1; i <= m; i++) b[x][i] ^= 1;
}
void rev_row(int x) {
  for (int i = 1; i <= n; i++) b[i][x] ^= 1;
}
bool check(int x) {
  for (int i = 2; i <= m; i++)
    if (b[x][i] != b[x][i - 1]) return false;
  return true;
}
bool checkx(int x) {
  int p1 = 1, p2 = m;
  while (b[x][p1 + 1] == b[x][p1]) p1++;
  while (b[x][p2 - 1] == b[x][p2]) p2--;
  return (p2 == p1 + 1);
}
int solve(int l, int r) {
  int pos = -1;
  for (int i = l; i <= r; i++) {
    if (!check(i)) {
      if (!checkx(i)) return 0;
      if (pos != -1) return 0;
      pos = i;
    }
  }
  for (int i = l; i < pos; i++)
    if (b[i][1]) ans_line[i] = 1;
  if (pos != -1) {
    if (b[pos][1]) ans_line[pos] = 1;
  }
  for (int i = max(pos + 1, 1); i <= r; i++)
    if (!b[i][1]) ans_line[i] = 1;
}
void print() {
  puts("YES");
  for (int i = 1; i <= n; i++) printf("%d", ans_line[i]);
  puts("");
  for (int i = 1; i <= m; i++) printf("%d", ans_row[i]);
  puts("");
}
int main() {
  n = read();
  m = read();
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) a[i][j] = read();
  if (n == 1) {
    for (int i = 1; i <= m; i++)
      if (a[1][i]) ans_row[i] = 1;
    print();
    return 0;
  }
  memcpy(b, a, sizeof(a));
  memset(ans_line, 0, sizeof(ans_line));
  memset(ans_row, 0, sizeof(ans_row));
  for (int i = 1; i <= m; i++)
    if (b[1][i]) ans_row[i] = 1, rev_row(i);
  if (solve(2, n)) return print(), 0;
  memcpy(b, a, sizeof(a));
  memset(ans_line, 0, sizeof(ans_line));
  memset(ans_row, 0, sizeof(ans_row));
  rev_line(1);
  ans_line[1] = 1;
  for (int i = 1; i <= m; i++)
    if (b[1][i]) ans_row[i] = 1, rev_row(i);
  if (solve(2, n)) return print(), 0;
  memcpy(b, a, sizeof(a));
  memset(ans_line, 0, sizeof(ans_line));
  memset(ans_row, 0, sizeof(ans_row));
  for (int i = 1; i <= m; i++)
    if (!b[n][i]) ans_row[i] = 1, rev_row(i);
  if (solve(1, n - 1)) return print(), 0;
  memcpy(b, a, sizeof(a));
  memset(ans_line, 0, sizeof(ans_line));
  memset(ans_row, 0, sizeof(ans_row));
  rev_line(n);
  ans_line[n] = 1;
  for (int i = 1; i <= m; i++)
    if (!b[n][i]) ans_row[i] = 1, rev_row(i);
  if (solve(1, n - 1)) return print(), 0;
  puts("NO");
  return 0;
}
