#include <bits/stdc++.h>
using namespace std;
const long long llINF = 9223372036854775807;
const int INF = 2147483647;
const int maxn = 2e5 + 7;
const int maxm = 5e4 + 7;
const long long mod = 1e9 + 7;
const double pi = acos(-1.0);
const double eps = 1e-12;
int n, m;
int a[207][207], r[207], c[207], b[207][207];
int x, y;
bool check() {
  for (int j = 1; j <= m; j++) c[j] = a[1][j] ^ b[1][j];
  for (int i = 2; i <= n; i++) {
    r[i] = a[i][1] ^ b[i][1] ^ c[1];
    for (int j = 2; j <= m; j++)
      if ((r[i] ^ c[j]) != (a[i][j] ^ b[i][j])) return false;
  }
  return true;
}
int main(int argc, char const *argv[]) {
  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 <= n; i++)
    for (int j = 1; j <= m; j++) b[i][j] = 1;
  x = 1;
  y = 1;
  for (int i = 0; i <= n * m; i++) {
    if (check()) {
      printf("YES\n");
      for (int j = 1; j <= n; j++) printf("%d", r[j]);
      printf("\n");
      for (int j = 1; j <= m; j++) printf("%d", c[j]);
      printf("\n");
      return 0;
    }
    b[x][y] = 0;
    y++;
    if (y == m + 1) {
      x++;
      y = 1;
    }
  }
  printf("NO\n");
  return 0;
}
