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.BigInteger;
import java.util.*;
import java.lang.*;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import java.util.stream.Stream;

public class Contest {
	//static ArrayList<Integer> prime=new ArrayList();
	
	   public static TreeMap<Long,Integer> t1=new TreeMap();
	    public static void solve()
	    {
	      long m=1;
	      for(int j=2;j<=1000;j++)
	      {
	         
	          if(isprime(j))
	          {
	              m=m*j;
	              if(m>1000000)
	              {
	                  break;
	              }else{
	                  t1.put(m,1);
	              }
	          }
	      }
	    }
	public static long gcd(long n1, long n2)
    {
        if (n2 != 0)
            return gcd(n2, n1 % n2);
        else
            return n1;
    }
	
//////////////////	
	public static class trie {
        int x,y,z;
        trie (int x,int y,int z){
            this.x=x;
            this.y=y;
            this.z=z;
        }
	
	} 
        
	public static class pair {
        int x,y;
        pair (int x,int y){
            this.x=x;
            this.y=y;
        }
        public boolean equals(Object o) {
        	if(o instanceof pair) {
        		pair p = (pair)o;
        		return (x == p.x && y == p.y);
        	}
        	return false;
        }
        public int hashCode() {
        	return (Integer.hashCode(x) * 3 + Integer.hashCode(y) );
        }
    }
	
//////////////////	
	
	static class Cmp implements Comparator<pair>
	{
		public int compare(pair a,pair b)
		{
			if(a.x==b.x)
			{
				return(a.y-b.y);
			}
			return(a.x-b.x);
		}
	}
	
	
//////////////////
	
	
	
	
//////////////////
	
	
	
	
	
	   static class FastReader
	   {
		   BufferedReader br;
		   StringTokenizer st;
		   public FastReader()
		   {
			   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; 
	        } 
	   }
	   
////////////////////// 
	//public static ArrayList<Integer> a=new ArrayList();
	   
	  public static long Divisors(long n) 
	   { 
	       // Note that this loop runs till square root 
		   long sum=0;
	       for (long i=1; i*i<=(n); i++) 
	       { 
	           if (n%i == 0) 
	           { 
	               // If divisors are equal, print only one 
	               if (n/i == i) 
	               {
	                  // printf("%d ", i); 
	            	   sum=sum+1;
	            	 //  a.add(i);
	               }
	     
	               else // Otherwise print both 
	               {
	                   //printf("%d %d ", i, n/i); 
	            	   sum=sum+2;
	            	  // a.add(i);
	            	   //a.add(n/i);
	               }
	           } 
	       } 
	       return(sum);
	   } 
	   
/////////////////////	  
	  
	  public static long SmallestPrimeDivisor(long n) 
	  { 
	      // if divisible by 2 
	      if (n % 2 == 0) 
	          return 2; 
	    
	      // iterate from 3 to sqrt(n) 
	      for (long i = 3; i * i <= n; i += 2) { 
	          if (n % i == 0) 
	              return i; 
	      } 
	    
	      return n; 
	  } 
	    
////////////////////	  
	   
	   public static boolean isprime(long n)
	    {
	        int count=0;
	     
	        for(long i=2;i*i<=n;i++)
	        {
	            if(n%i==0)
	            {
	                return(false);
	            }
	        }
	        return(true);
	    }
	
	   
//////////////////////
	   
	     //   (x^n)%1000000007
	   public static long modularExponentiation(long x,long n,long M)
	   {
	       if(n==0)
	           return 1;
	       else if(n%2 == 0)        //n is even
	           return modularExponentiation((x*x)%M,n/2,M);
	       else                             //n is odd
	           return (x*modularExponentiation((x*x)%M,(n-1)/2,M))%M;

	   }
	   
	   public static long nCr(int n,int k)
	   {
		  if(k==0)
			  return 1;
		  return(n*nCr(n-1,k-1)/k);
	   }
	   public static long factorial(int n)
	   {
		   if(n==1)
			   return 1;
		   return((n)*factorial(n-1));
	   }
	   
	   public static void debug(Object...o) {
		    System.out.println( Arrays.deepToString(o) );
	   }
	   
	   public static boolean prime[]=new boolean[100005];
	   //prime[j]==false means it's a prime.
	   public static void seive()
	   {
		   prime[0]=false;
		   prime[1]=false;
		   for(int i=2;i*i<=100005;i++)
		   {
			   if(!prime[i])
			   {
				   for(int j=i*i;i<=100005;j+=i)
				   {
					   prime[j]=true;
				   }
			   }
		   }
	   }
	    public static long AtMost(int k,char c[])
	    {
	    	long ans=0;
	    	int left=0,right=0;
	    	int n=c.length;
	    	HashMap<Character,Integer> h=new HashMap();
	    	h.put('1',0);
	    	while(right<n)
	    	{
	    		h.put(c[right],h.getOrDefault(c[right],0)+1);
	    		while(h.get('1')>k)
	    		{
	    			h.replace(c[left],h.get(c[left])-1);
	    			left++;
	    		}
	    		ans=ans+(right-left+1);
	    		right++;
	    	}
	    	return ans;
	    }
	 
	 
	   
	   
	   
	   
	   

		public static void main(String []args) throws Exception
		{
			
			
			 FastReader in =new FastReader();	
			 PrintWriter pw = new PrintWriter(System.out);
		    //Scanner sc=new Scanner(System.in)
			// int x=in.nextInt();
			//String a[]=in.nextLine().split(" ");
			//String b=in.nextLine();
			int m=in.nextInt();
			int n=in.nextInt();
			int b[][]=new int[m][n];
			int a[][]=new int[m][n];
			for(int i=0;i<m;i++)
			{
				for(int j=0;j<n;j++)
				{
					b[i][j]=in.nextInt();
				}
			}
			for(int i=0;i<m;i++)
			{
				for(int j=0;j<n;j++)
				{
				   if(b[i][j]==0)
				   {
					   for(int k=0;k<n;k++)
					   {
						   a[i][k]=2;
					   }
					   for(int k=0;k<m;k++)
					   {
						   a[k][j]=2;
					   }
				   }
				}
			}
			for(int i=0;i<m;i++)
			{
				for(int j=0;j<n;j++)
				{
				    if(a[i][j]==0)
				    {
				    	a[i][j]=1;
				    }
				}
			}
			int m1=0,m2=0;
			for(int i=0;i<m;i++)
			{
				//m1=0;
				for(int j=0;j<n;j++)
				{
					int x=0;
					m1=0;
					if(b[i][j]==1)
					{
						x=1;
						for(int k=0;k<n;k++)
						{
							if(a[i][k]==1)
							{
								m1=1;
								break;
							}
						}
						for(int k=0;k<m && m1==0;k++)
						{
							if(a[k][j]==1)
							{
								m1=1;
								break;
							}
						}
					}
					if(x==1 && m1==0)
					{
						i=m+5;
						j=n+5;
						m2=1;
						break;
					}
				}
			}
			if(m2==1)
			{
				pw.println("NO");
			}
			else
			{
				pw.println("YES");
				for(int i=0;i<m;i++)
				{
					for(int j=0;j<n;j++)
					{
						
					    if(a[i][j]==2)
					    {
					    	a[i][j]=0;
					    }
					    
					    pw.print(a[i][j]+" ");
					}
					pw.println("");
				}
				
			}
				
			pw.flush();
			pw.close();
		   			
		}
			
	}