#include <bits/stdc++.h>
using namespace std;
const int MN = 205, inf = 1000000005, mod = 1000000007;
const long long INF = 1000000000000000005LL;
bitset<MN> A[MN], cur[MN];
int H[MN], V[MN];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j) {
      int b;
      scanf("%d", &b);
      A[i][j] = b;
    }
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      H[j] = (A[i][j] ^ 1);
      for (int k = 1; k <= n; ++k) cur[k][j] = (A[k][j] ^ H[j]);
    }
    for (int j = 0; j <= m; ++j) {
      if (j) {
        H[j] ^= 1;
        for (int k = 1; k <= n; ++k) cur[k][j] = (cur[k][j] ^ 1);
      }
      bool dupa = false;
      for (int k = 1; k < i; ++k) {
        if (cur[k].count() == m)
          V[k] = 1;
        else if (cur[k].count() == 0)
          V[k] = 0;
        else
          dupa = true;
      }
      V[i] = 0;
      for (int k = i + 1; k <= n; ++k) {
        if (cur[k].count() == m)
          V[k] = 0;
        else if (cur[k].count() == 0)
          V[k] = 1;
        else
          dupa = true;
      }
      if (dupa == false) {
        printf("YES\n");
        for (int i = 1; i <= n; ++i) printf("%d", (int)V[i]);
        printf("\n");
        for (int i = 1; i <= m; ++i) printf("%d", (int)H[i]);
        return 0;
      }
    }
    for (int j = 1; j <= m; ++j) {
      H[j] = (A[i][j] ^ 1);
      for (int k = 1; k <= n; ++k) cur[k][j] = (A[k][j] ^ H[j]);
    }
    for (int j = m; j > 0; --j) {
      if (j) {
        H[j] ^= 1;
        for (int k = 1; k <= n; ++k) cur[k][j] = (cur[k][j] ^ 1);
      }
      bool dupa = false;
      for (int k = 1; k < i; ++k) {
        if (cur[k].count() == m)
          V[k] = 1;
        else if (cur[k].count() == 0)
          V[k] = 0;
        else
          dupa = true;
      }
      V[i] = 0;
      for (int k = i + 1; k <= n; ++k) {
        if (cur[k].count() == m)
          V[k] = 0;
        else if (cur[k].count() == 0)
          V[k] = 1;
        else
          dupa = true;
      }
      if (dupa == false) {
        printf("YES\n");
        for (int i = 1; i <= n; ++i) printf("%d", (int)V[i]);
        printf("\n");
        for (int i = 1; i <= m; ++i) printf("%d", (int)H[i]);
        return 0;
      }
    }
  }
  printf("NO");
}
