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.util.*;
import java.lang.*;
import java.io.*;



public class or_matrix{
	public static void main(String[] args) {

		InputReader fi = new InputReader(System.in);
		PrintWriter pr = new PrintWriter(System.out);

		int m=fi.nextInt();
		int n=fi.nextInt();
		int[][] arr=new int[m][n];
		int[][] arr1=new int[m][n];

		for (int i = 0; i <m ; i++) {
			for (int j = 0; j <n ; j++) {
				arr[i][j]=fi.nextInt();
				arr1[i][j]=1;
			}
		}
		int flagr=0;
		int flag1=0,flag2=0;


		outer1:
		for (int i = 0; i <m ; i++) {
			for (int j = 0; j <n ; j++) {
				if (arr[i][j] == 0) {
					for (int l = 0; l < n; l++) {
						arr1[i][l] = 0;
					}
					for (int k = 0; k < m; k++) {
						arr1[k][j] = 0;
					}
					//pr.printf("YEah !! When i : %d and j : %d ***********************\n", i, j);
				}

			}
		}
		outer:
		for (int i = 0; i <m ; i++) {
			for (int j = 0; j <n ; j++) {
				 if(arr[i][j]==1)
				{

					//pr.printf("When i : %d and j : %d ***********************\n",i,j);
					flag1=0;
					flag2=0;
					for (int l = 0; l <n ; l++) {
						//pr.println("check1");
							if(arr1[i][l]==0)
							{
								flag1=1;
							}
							else
							{
								//pr.println("check111");
								flag1=0;
								break;
							}

					}
					for (int l = 0; l <m ; l++) {
						//pr.println("check2");

						if(arr1[l][j]==0)
						{
							flag2=1;
						}
						else
						{
							//pr.println("check222");
							flag2=0;
							break;
						}
					}
					if((flag1==1)&&(flag2==1))
					{
						//pr.println("check3");

						flagr=1;
						break outer;
					}

				}
			}
		}

		if(flagr==1)
			pr.println("NO");
		else
		{
			pr.println("YES");
			for (int i = 0; i <m ; i++) {
				for (int j = 0; j <n ; j++) {
					pr.printf("%d ",arr1[i][j]);
				}
				pr.println();

			}
		}



		pr.close();

	}

}

class InputReader {
	private InputStream stream;
	private byte[] buf = new byte[8192];
	private int curChar, snumChars;
	private SpaceCharFilter filter;

	public InputReader(InputStream stream) {
		this.stream = stream;
	}

	public int snext() {
		if (snumChars == -1)
			throw new InputMismatchException();
		if (curChar >= snumChars) {
			curChar = 0;
			try {
				snumChars = stream.read(buf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (snumChars <= 0)
				return -1;
		}
		return buf[curChar++];
	}

	public int nextInt() {
		int c = snext();
		while (isSpaceChar(c))
			c = snext();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = snext();
		}
		int res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = snext();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	public long nextLong() {
		int c = snext();
		while (isSpaceChar(c))
			c = snext();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = snext();
		}
		long res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = snext();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	public int[] nextIntArray(int n) {
		int a[] = new int[n+1];
		for (int i = 1; i <= n; i++)
			a[i] = nextInt();
		return a;
	}

	public String readString() {
		int c = snext();
		while (isSpaceChar(c))
			c = snext();
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = snext();
		} while (!isSpaceChar(c));
		return res.toString();
	}

	public boolean isSpaceChar(int c) {
		if (filter != null)
			return filter.isSpaceChar(c);
		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	}

	public interface SpaceCharFilter {
		public boolean isSpaceChar(int ch);
	}
}