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

 
 
 
public class B {
 
    static MyScanner in = new MyScanner();
    static   PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    static StringTokenizer st;
    static long H,W;
    static BitSet bs;
    static long mod = 1000000007;
      // All possible moves of a knight 
    static   int X[] = { 2, 1, -1, -2, -2, -1, 1, 2 }; 
    static int Y[] = { 1, 2, 2, 1, -1, -2, -2, -1 }; 
    static int [] dr   = {-1,0,0,1};
    static int [] dc = {0,1,-1,0};
   
    public static void main(String args[]) throws IOException {
    /**
1.What is the unknown:
2.What are the data: an array of tlen ght  the value is 10^9
3.What is the condition: 
4. understand the problem:
5. What are the cases edges in the problem:
6.What what max:
7. Are you using a data stcuture. And which one:
8.Is there reursion what is the base case. For example COINS:
*/
            int n = in.nextInt();
            int m= in.nextInt();
            boolean work = true;
            int [][] B = new int[n][m];
            int[][]b = new int [n][m];
            int [][] A = new int[n][m];
            for(int i=0;i<n;i++){
                Arrays.fill(A[i], 1);
               }
            for(int i=0;i<n;i++){
                for(int j=0;j<m;j++){
                  int k  = in.nextInt();
                  b[i][j] = k;
                  if(k==0){
                        //go sideway
                       for(int p=0;p<m;p++){
                            A[i][p] = 0;
                        }
                        for(int p=0;p<n;p++){
                            A[p][j] = 0;
                        }

                  }
                }
            }
            //create the B matrix
            for(int i=0;i<n;i++)
                for(int j=0;j<m;j++){
                    if(A[i][j] ==1){
                         //go sideway
                         for(int p=0;p<m;p++){
                            B[i][p] = 1;
                        }
                        for(int p=0;p<n;p++){
                            B[p][j] = 1;
                        } 
                    }
                }
                for(int i=0;i<n;i++)
                    for(int j=0;j<m;j++)
                        if(b[i][j]!=B[i][j])
                            work = false;
        if(work){
            out.println("YES");
            for(int i=0;i<n;i++){
                for(int j=0;j<m;j++){
                 out.print(A[i][j]+" ");
                }
                out.print("\n");
            }
        }else{
            out.print("NO");
        }                    
                out.flush();
    }
    
    public static boolean subseqeunce(String s, String t){
        for(int i=0,j=0;i<s.length();i++){
            if(j<t.length()&&s.charAt(i)==t.charAt(j)){
                j++;
            }
            if(j==t.length()) return true;
        }
        return false;
    }

    
    private static int lowrBound(int[] a, int lo, int hi, int element) {
        while(lo<hi){
            int mid = lo+(hi-lo)/2;
            if(element>a[mid]){
                lo = mid+1;
            }else{
                hi  = mid;
            }
        }
        if(lo<a.length&&a[lo]==element){
            return lo+1;
        }
        return lo;
    }

    static long lcm(int a, int b) {
        return (a*b)/gcd(a, b);
    }
    static boolean isVowel(char c) {
        if(c=='a'||c=='e'||c=='i'||c=='o'||c=='u'||c=='y'){
            return true;
        }
        return false ;
    }
    static class IP implements Comparable<IP>{
        public int first,second;
        IP(int first, int second){
            this.first = first;
            this.second = second;
        }
        public int compareTo(IP ip){
            if(first==ip.first)
                return second-ip.second;
            return first-ip.first;    
        }
        @Override
        public String toString() {
            return first+" "+second;
        }
 
    }
        
       static long gcd(long a, long b){
        return b!=0?gcd(b, a%b):a;
    }
 
        static boolean isEven(long a) {
            return (a&1)==0;
        }
    
    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;
   
        public MyScanner() {
           br = new BufferedReader(new InputStreamReader(System.in));
        }
   
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
   
        int nextInt() {
            return Integer.parseInt(next());
        }
   
        long nextLong() {
            return Long.parseLong(next());
        }
   
        double nextDouble() {
            return Double.parseDouble(next());
        }
   
        String nextLine(){
            String str = "";
        try {
           str = br.readLine();
        } catch (IOException e) {
           e.printStackTrace();
        }
        return str;
        }
  
     }
}