Problem: You are given a binary matrix a of size n × m. A binary matrix is a matrix where each element is either 0 or 1.

You may perform some (possibly zero) operations with this matrix. During each operation you can inverse the row of this matrix or a column of this matrix. Formally, inverting a row is changing all values in this row to the opposite (0 to 1, 1 to 0). Inverting a column is changing all values in this column to the opposite.

Your task is to sort the initial matrix by some sequence of such operations. The matrix is considered sorted if the array [a_{1, 1}, a_{1, 2}, ..., a_{1, m}, a_{2, 1}, a_{2, 2}, ..., a_{2, m}, ..., a_{n, m - 1}, a_{n, m}] is sorted in non-descending order.

Input

The first line of the input contains two integers n and m (1 ≤ n, m ≤ 200) — the number of rows and the number of columns in the matrix.

The next n lines contain m integers each. The j-th element in the i-th line is a_{i, j} (0 ≤ a_{i, j} ≤ 1) — the element of a at position (i, j).

Output

If it is impossible to obtain a sorted matrix, print "NO" in the first line.

Otherwise print "YES" in the first line. In the second line print a string r of length n. The i-th character r_i of this string should be '1' if the i-th row of the matrix is inverted and '0' otherwise. In the third line print a string c of length m. The j-th character c_j of this string should be '1' if the j-th column of the matrix is inverted and '0' otherwise. If there are multiple answers, you can print any.

Examples

Input


2 2
1 1
0 1


Output


YES
00
10


Input


3 4
0 0 0 1
0 0 0 0
1 1 1 1


Output


YES
010
0000


Input


3 3
0 0 0
1 0 1
1 1 0


Output


NO

Solution (in JAVA):

Solution:
/*
If you want to aim high, aim high
Don't let that studying and grades consume you
Just live life young
******************************
What do you think? What do you think?
1st on Billboard, what do you think of it
Next is a Grammy, what do you think of it
However you think, I’m sorry, but shit, I have no fcking interest
*******************************
I'm standing on top of my Monopoly board
That means I'm on top of my game and it don't stop
til my hip don't hop anymore
https://www.a2oj.com/Ladder16.html
*******************************
300IQ as writer = Sad!
*/
import java.util.*;
import java.io.*;
import java.math.*;

   public class x1157G
   {
      public static void main(String hi[]) throws Exception
      {
         BufferedReader infile = new BufferedReader(new InputStreamReader(System.in));  
         StringTokenizer st = new StringTokenizer(infile.readLine());
         int N = Integer.parseInt(st.nextToken());
         int M = Integer.parseInt(st.nextToken());
         int[][] grid = new int[N][M];
         for(int i=0; i < N; i++)
            grid[i] = readArr(M, infile, st);
         int[][] temp = new int[N][M];
         int[] rowflip = new int[N];
         int[] colflip = new int[M];
         for(int c=0; c < M; c++)
            if(grid[0][c] == 1)
               colflip[c] = 1;
         for(int r=0; r < N; r++)
            for(int c=0; c < M; c++)
               temp[r][c] = grid[r][c]^colflip[c];
         int dex = -1;
         for(int r=1; r < N; r++)
         {
            int sum = 0;
            for(int x: temp[r])
               sum += x;
            if(sum > 0 && sum < M)
            {
               if(dex != -1)
               {
                  dex = -69;
                  break;
               }
               int tempo = -1;
               for(int i=0; i < M-1; i++)
                  if(temp[r][i] != temp[r][i+1])
                  {
                     tempo = i+1;
                     break;
                  }
               if(sum == tempo || M-sum == tempo)
                  dex = r;
               else
               {
                  dex = -69;
                  break;
               }
            }
         }
         if(dex != -69)
         {
            System.out.println("YES");
            StringBuilder sb = new StringBuilder();
            if(dex == -1)
            {
               for(int r=1; r < N; r++)
                  if(temp[r][0] == 0)
                     rowflip[r] = 1;
               for(int r=0; r < N; r++)
                  sb.append(rowflip[r]);
               sb.append("\n");
               for(int x: colflip)
                  sb.append(x);
               System.out.println(sb);
            }
            else
            {
               for(int r=1; r <= dex; r++)
                  if(temp[r][0] == 1)
                     rowflip[r] = 1;
               for(int r=dex+1; r < N; r++)
                  if(temp[r][0] == 0)
                     rowflip[r] = 1;
               for(int r=0; r < N; r++)
                  sb.append(rowflip[r]);
               sb.append("\n");
               for(int x: colflip)
                  sb.append(x);
               System.out.println(sb);
            }
            return;
         }
         //set other
         temp = new int[N][M];
         rowflip = new int[N];
         colflip = new int[M];
         for(int c=0; c < M; c++)
            if(grid[N-1][c] == 0)
               colflip[c] = 1;
         for(int r=0; r < N; r++)
            for(int c=0; c < M; c++)
               temp[r][c] = grid[r][c]^colflip[c];
         dex = -1;
         for(int r=0; r < N-1; r++)
         {
            int sum = 0;
            for(int x: temp[r])
               sum += x;
            if(sum > 0 && sum < M)
            {
               if(dex != -1)
               {
                  dex = -69;
                  break;
               }
               int tempo = -1;
               for(int i=0; i < M-1; i++)
                  if(temp[r][i] != temp[r][i+1])
                  {
                     tempo = i+1;
                     break;
                  }
               if(sum == tempo || M-sum == tempo)
                  dex = r;
               else
               {
                  dex = -69;
                  break;
               }
            }
         }
         if(dex != -69)
         {
            System.out.println("YES");
            StringBuilder sb = new StringBuilder();
            if(dex == -1)
            {
               for(int r=0; r < N-1; r++)
                  if(temp[r][0] == 1)
                     rowflip[r] = 1;
               for(int r=0; r < N; r++)
                  sb.append(rowflip[r]);
               sb.append("\n");
               for(int x: colflip)
                  sb.append(x);
               System.out.println(sb);
            }
            else
            {
               for(int r=0; r <= dex; r++)
                  if(temp[r][0] == 1)
                     rowflip[r] = 1;
               for(int r=dex+1; r < N; r++)
                  if(temp[r][0] == 0)
                     rowflip[r] = 1;
               for(int r=0; r < N; r++)
                  sb.append(rowflip[r]);
               sb.append("\n");
               for(int x: colflip)
                  sb.append(x);
               System.out.println(sb);
            }
            return;
         }
         else
            System.out.println("NO");
      }
      public static int[] readArr(int N, BufferedReader infile, StringTokenizer st) throws Exception
      {
         int[] arr = new int[N];
         st = new StringTokenizer(infile.readLine());
         for(int i=0; i < N; i++)
            arr[i] = Integer.parseInt(st.nextToken());
         return arr;
      }
   }