Problem: Let's define logical OR as an operation on two logical values (i. e. values that belong to the set {0, 1}) that is equal to 1 if either or both of the logical values is set to 1, otherwise it is 0. We can define logical OR of three or more logical values in the same manner:

<image> where <image> is equal to 1 if some ai = 1, otherwise it is equal to 0.

Nam has a matrix A consisting of m rows and n columns. The rows are numbered from 1 to m, columns are numbered from 1 to n. Element at row i (1 ≤ i ≤ m) and column j (1 ≤ j ≤ n) is denoted as Aij. All elements of A are either 0 or 1. From matrix A, Nam creates another matrix B of the same size using formula:

<image>.

(Bij is OR of all elements in row i and column j of matrix A)

Nam gives you matrix B and challenges you to guess matrix A. Although Nam is smart, he could probably make a mistake while calculating matrix B, since size of A can be large.

Input

The first line contains two integer m and n (1 ≤ m, n ≤ 100), number of rows and number of columns of matrices respectively.

The next m lines each contain n integers separated by spaces describing rows of matrix B (each element of B is either 0 or 1).

Output

In the first line, print "NO" if Nam has made a mistake when calculating B, otherwise print "YES". If the first line is "YES", then also print m rows consisting of n integers representing matrix A that can produce given matrix B. If there are several solutions print any one.

Examples

Input

2 2
1 0
0 0


Output

NO


Input

2 3
1 1 1
1 1 1


Output

YES
1 1 1
1 1 1


Input

2 3
0 1 0
1 1 1


Output

YES
0 0 0
0 1 0

Solution (in JAVA):

Solution:
import java.io.*;
import java.util.*;
import java.math.*;
public class cf {
	public static Scanner I=new Scanner(System.in);


	// 277
	public static void CalculatingFunction() {
		long n=I.nextLong();
		System.out.printf("%d\n",(long)Math.pow(-1.0,(double)n)*(long)Math.ceil(n/2.0));
	}


	public static void ZeroMatrix(int [][]A,int row,int col,int c) {
		
		for(int j=0; j<A[0].length; j++) {
			A[row][j]=c;
		}

		for(int i=0; i<A.length; i++) {
			A[i][col]=c;
		}
	}

	public static boolean sameMatrix(int [][]A, int [][]B) {
		for(int i=0; i<A.length; i++) {
			for(int j=0; j<A[0].length; j++) {
				if(A[i][j]!=B[i][j]) {
					return false;
				}
			}
		}
		return true;
	}
	public static void printMatrix(int [][]A) {
		for(int i=0; i<A.length; i++) {
			for(int j=0; j<A[0].length; j++) {
				System.out.printf("%d ",A[i][j]);
			}
			System.out.printf("\n");
		}
		
	}
	public static void OrinMatrix() {
		int m=I.nextInt();
		int n=I.nextInt();
		int [][]A=new int[m][n];
		int [][]B=new int[m][n];
		int [][]C=new int[m][n];
		for(int i=0; i<m; i++) {
			for(int j=0; j<n; j++) {
				A[i][j]=I.nextInt();
				B[i][j]=1;
				C[i][j]=0;
			}
		}


		for(int i=0; i<m; i++) {
			for(int j=0; j<n; j++) { 
				if(A[i][j]==0) {
					ZeroMatrix(B,i,j,0);				
				}
			}
		}
		for(int i=0; i<m; i++) {
			for(int j=0; j<n; j++) {
				if(B[i][j]==1) {
					ZeroMatrix(C,i,j,1);
				}
			}
		}
		if(sameMatrix(A,C)) {
			System.out.printf("YES\n");	
			printMatrix(B);
		} else {
			System.out.printf("NO\n");
	
		}


	}
	// 276
	public static void Factory() {
		long a=I.nextLong();
		int m=I.nextInt();
		for(int i=0; i<m; i++) {
			if(a%m==0) {
				System.out.printf("Yes\n");
				return;
			}
			a+=a%m;
		}
		System.out.printf("No\n");
	}



	public static void ValuableResources() {
		int n=I.nextInt();
		int []x=new int[n];
		int []y=new int[n];
		for(int i=0; i<n; i++) {
			x[i]=I.nextInt();
			y[i]=I.nextInt();
		}
		Arrays.sort(x);
		Arrays.sort(y);
		int width=x[n-1]-x[0];
		int height=y[n-1]-y[0];
		int max=width>=height? width:height;
		System.out.printf("%d\n",(long)max*max);
	}

	public static void Bits() {
		int n=I.nextInt();
		for(int i=0; i<n; i++) {
			long l=I.nextLong();
			long r=I.nextLong();
			long maxBitCount=0;
			long maxBitNum=0;
			for(long j=l; j<=r; j++) {
				if(Long.bitCount(j)>maxBitCount) {
					maxBitCount=Long.bitCount(j);
					maxBitNum=j;
				}
			}
			System.out.printf("%d\n",maxBitNum);
		}
	}

	public static void reverse(int []A) {
		int i=0;
		int j=A.length-1;
		while(i<j) {
			int temp=A[i];
			A[i]=A[j];
			A[j]=temp;
			i++;
			j--;
		}
	}
	public static void MaximumValue() {
		int n=I.nextInt();
		int []A=new int[n];
		for(int i=0; i<n; i++) {
			A[i]=I.nextInt();
		}
		Arrays.sort(A);
		reverse(A);
		int max=0;
		for(int i=0; i<n; i++) {
			for(int j=i+1; j<n; j++) {
				if(A[i]%A[j]>max) {
					max=A[i]%A[j];
				}
			}
		}
		System.out.printf("%d\n",max);
	}
	// 275.5
    public static void swap(int[]A,int i, int j,StringBuilder str) {
        int temp=A[i];
        A[i]=A[j];
        A[j]=temp;
        str.append(String.format("%d %d\n",i,j));

    }

	public static void SwapSort() {
		int n=I.nextInt();
		int []A=new int[n];
		StringBuilder str=new StringBuilder();
		for(int i=0; i<n; i++) {
			A[i]=I.nextInt();
		}

		int count=0;
		for(int i=0; i<n; i++) {
			int minIndex=i;
			int min=A[i];
			for(int j=i+1; j<n; j++) {
				if(A[j]<min) {
					minIndex=j;
					min=A[j];
				}
			}
			if(i!=minIndex) {
				count++;
				swap(A,i,minIndex,str);
			}
		}
		System.out.printf("%d\n%s",count,str);
	}
	public static void BerSUBall() {
		int n=I.nextInt();
		int []A=new int[n];
		for(int i=0; i<n; i++) {
			A[i]=I.nextInt();
		}
		Arrays.sort(A);
		int m=I.nextInt();
		int []B=new int[m];
		for(int i=0; i<m; i++) {
			B[i]=I.nextInt();	
		} 
		Arrays.sort(B);
		int pair=0;
		int i=0;
		int j=0;
		while(i<n && j<m) {
			if(Math.abs(A[i]-B[j])<=1) {
				pair++;
				i++;
				j++;
			} else if (A[i]>B[j]) {
				j++;
			} else if (A[i]<B[j]) {
				i++;
			}
		}
		System.out.printf("%d\n",pair);

	}

	public static void GivenLengthandSumofDigits() {
		int m=I.nextInt();
		int s=I.nextInt();
		if(s>m*9 || (m>=2 && s==0)) {
			System.out.printf("-1 -1\n");
		} else if(m==1 && s==0) {
			System.out.printf("0 0\n");
		} else {

			//for max
			int div=s/9;
			int rem=s%9;
			char[]max=new char[m];
			int index=0;
			while(div>0) {
				max[index]='9';
				index++;
				div--;
			}
			if(rem!=0) {
				max[index]=Character.forDigit(rem,10);
				index++;
			}
			while(index<m) {
				max[index]='0';
				index++;
			}
			

			// for  min
			String min=new String(max);
			StringBuilder minsb=(new StringBuilder(min)).reverse();
			if(minsb.charAt(0)=='0') {
				minsb.setCharAt(0,'1');
				for(int i=1; i<minsb.length(); i++) {
					if(minsb.charAt(i)!='0') {
						minsb.setCharAt(i, (char)(minsb.charAt(i)-1));
						break;
					}
				}
			}
			

			System.out.printf("%s %s\n",new String(minsb),new String(max));

			
		}
	}
	public static void main(String[] args) {

		// 277
		//CalculatingFunction();
		OrinMatrix();
		// 276
		//Factory();
		//ValuableResources();
		//Bits();	
		//MaximumValue();
		// 277
		//SwapSort();
		//BerSUBall();
		//GivenLengthandSumofDigits();
	}
}