#include <bits/stdc++.h>
using namespace std;
const int N = 200;
unordered_map<bitset<N>, int> cnt;
bitset<N> a[N];
bool r[N];
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      char c;
      cin >> c;
      if (c == '1') a[i][j] = 1;
    }
    if (a[i][0]) {
      r[i] = 1;
      for (int j = 0; j < m; j++) a[i][j] = !a[i][j];
    }
    cnt[a[i]]++;
  }
  for (auto &kv : cnt) {
    if (kv.second == n) {
      cout << "YES\n";
      for (int i = 0; i < n; i++) cout << r[i];
      cout << '\n';
      for (int j = 0; j < m; j++) cout << a[0][j];
      cout << '\n';
      return 0;
    }
    if (kv.second == n - 1) {
      for (int i = 0; i < n; i++)
        if (kv.first != a[i]) {
          bitset<N> kek = kv.first ^ a[i];
          int at = m;
          for (int j = 0; j < m; j++)
            if (kek[j]) {
              at = j;
              break;
            }
          for (int j = at; j < m; j++)
            if (!kek[j]) {
              at = -1;
              break;
            }
          if (at < 0) break;
          cout << "YES\n";
          for (int j = 0; j <= i; j++) cout << r[j];
          for (int j = i + 1; j < n; j++) cout << !r[j];
          cout << '\n';
          at = !i;
          for (int j = 0; j < m; j++) cout << a[at][j];
          cout << '\n';
          return 0;
        }
    }
  }
  cout << "NO\n";
}
