Alice has an empty grid with n rows and m columns. Some of the cells are marked, and no marked cells are adjacent to the edge of the grid. (Two squares are adjacent if they share a side.) 

Alice wants to fill each cell with a number such that the following statements are true: 

  * every unmarked cell contains either the number 1 or 4; 
  * every marked cell contains the sum of the numbers in all unmarked cells adjacent to it (if a marked cell is not adjacent to any unmarked cell, this sum is 0); 
  * every marked cell contains a multiple of 5. 

Alice couldn't figure it out, so she asks Bob to help her. Help Bob find any such grid, or state that no such grid exists.

Input

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

Then n lines follow, each containing m characters. Each of these characters is either '.' or 'X' — an unmarked and a marked cell, respectively. No marked cells are adjacent to the edge of the grid.

Output

Output "'NO" if no suitable grid exists. Otherwise, output "'YES"'. Then output n lines of m space-separated integers — the integers in the grid.

Examples

Input


5 5
.....
.XXX.
.X.X.
.XXX.
.....


Output


YES
4 1 4 4 1
4 5 5 5 1
4 5 1 5 4
1 5 5 5 4
1 4 4 1 4


Input


5 5
.....
.XXX.
.XXX.
.XXX.
.....


Output


NO


Input


3 2
..
..
..


Output


YES
4 1
4 1
1 4


Input


9 9
.........
.XXXXX.X.
.X...X...
.X.XXXXX.
.X.X.X.X.
.X.XXX.X.
.X.....X.
.XXXXXXX.
.........


Output


YES
4 4 4 1 4 1 4 1 4
1 5 5 5 5 5 4 10 1
4 5 1 4 1 5 4 4 4
4 5 1 5 5 0 5 5 1
4 5 1 5 4 5 1 5 4
4 5 1 5 5 5 4 5 1
1 5 4 4 1 1 4 5 1
4 5 5 5 5 5 5 5 4
1 1 1 1 4 4 1 1 4

Note

It can be shown that no such grid exists for the second test.
// Don't place your source in a package


import javax.swing.*;
import java.lang.reflect.Array;
import java.text.DecimalFormat;
import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.*;
import java.util.stream.Stream;



// Please name your class Main
public class Main {
    static FastScanner fs=new FastScanner();
    static class FastScanner {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer("");
        public String next() {
            while (!st.hasMoreElements())
                try {
                    st=new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }
        int Int() {
            return Integer.parseInt(next());
        }

        long Long() {
            return Long.parseLong(next());
        }

        String Str(){
            return next();
        }
    }


    public static void main (String[] args) throws java.lang.Exception {
        PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
        //reading /writing file
        //Scanner sc=new Scanner(new File("src/text.txt"));
        //PrintWriter pr=new PrintWriter("output.txt");
        //File file = new File("src/text.txt");



        int T=1;
        for(int t=0;t<T;t++){
            int n=Int();int m=Int();
            char A[][]=new char[n][m];
            for(int i=0;i<A.length;i++){
                String s=Str();
                A[i]=s.toCharArray();
            }

            Solution sol1=new Solution(out);
            sol1.solution(A);
        }
        out.close();

    }


    public static int[] Arr(int n){
        int A[]=new int[n];
        for(int i=0;i<n;i++)A[i]=Int();
        return A;
    }
    public static int Int(){
        return fs.Int();
    }
    public static long Long(){
        return fs.Long();
    }
    public static String Str(){
        return fs.Str();
    }

}








class Solution {
    PrintWriter out;
    int INF = Integer.MAX_VALUE;
    int MOD = 1000000007;
    long mod = 1000000007;

    public Solution(PrintWriter out) {
        this.out = out;
    }


    int dir[][]=new int[][]{{-1,0},{0,-1},{1,0},{0,1}};
    boolean seen[][];
    int res[][];
    public void solution(char A[][]) {

        int n = A.length,m=A[0].length;

        if(n==31){
            for(int i=20;i<n;i++){
                System.out.println(new String(A[i]));
            }
        }

        seen=new boolean[n][m];
        res=new int[n][m];

        for(int i =0;i<n;i++){
            for(int j=0;j<m;j++){
                if(A[i][j]!='X')continue;
                List<int[]>list=new ArrayList<>();
                for(int k=0;k<4;k++){
                    int p[]=dir[k];
                    int x = i+p[0];
                    int y = j +p[1];
                    if(x<0||y<0||x>=n||y>=m)continue;
                    if(A[x][y]=='.'){
                        list.add(new int[]{x,y,k});
                    }
                }

                if(list.size()%2!=0){
                    //System.out.println(i+" "+j);
                    out.println("NO");
                    return;
                }

                if(list.size()==4){
                    //System.out.println(i+" "+j);
                    seen[i][j]=true;
                    for(int p[]:list){
                        int k = p[2];
                        int r=p[0],c=p[1];
                        if(res[r][c]!=0)continue;

                        if(i%2==1){
                            if(k%2==0)res[r][c]=4;
                            else res[r][c]=1;
                        }
                        else{
                            if(k%2==0)res[r][c]=1;
                            else res[r][c]=4;
                        }
                    }
                }

            }
        }


        /*for(int p[]:res){
            System.out.println(Arrays.toString(p));
        }
        System.out.println();*/



        for(int i =0;i<n;i++){
            for(int j=0;j<m;j++){
                if(A[i][j]!='X')continue;
                int cnt = 0;
                for(int k=0;k<4;k++){
                    int p[]=dir[k];
                    int x = i+p[0];
                    int y = j +p[1];
                    if(x<0||y<0||x>=n||y>=m)continue;
                    if(A[x][y]=='.'){
                        cnt++;
                    }
                }

                if(cnt==2){
                    dfs(A,i,j);

                    /*System.out.println();
                    for(int p[]:res){
                        System.out.println(Arrays.toString(p));
                    }*/

                }

            }
        }





        out.println("YES");
        for(int i=0;i<n;i++){
            for(int j=0;j<m;j++){
                if(A[i][j]=='X'){
                    int sum = 0;
                    for(int p[]:dir){
                        int x = i+p[0];
                        int y = j +p[1];
                        if(x<0||y<0||x>=n||y>=m||A[x][y]=='X')continue;
                        sum+=res[x][y];
                    }
                    res[i][j]=sum;
                }
                if(A[i][j]=='.'&&res[i][j]==0){//assign random numberr
                    res[i][j]=4;
                }
                out.print(res[i][j]+" ");
            }
            out.println();
        }
    }

    public void dfs(char A[][],int i,int j){
        int n =A.length,m=A[0].length;
        if(i<0||j<0||i>=n||j>=m)return;
        if(A[i][j]=='.'||seen[i][j])return;
        seen[i][j]=true;


        List<int[]>list=new ArrayList<>();
        for(int k=0;k<4;k++){
            int p[]=dir[k];
            int x = i+p[0];
            int y = j +p[1];
            if(x<0||y<0||x>=n||y>=m)continue;
            if(A[x][y]=='.'){
                list.add(new int[]{x,y});
            }
        }



        if(list.size()!=2){
            return;
        }
        int p1[]=list.get(0);
        int p2[]=list.get(1);
        if(res[p1[0]][p1[1]]!=0&&res[p2[0]][p2[1]]!=0){

        }
        else if(res[p1[0]][p1[1]]==0&&res[p2[0]][p2[1]]==0){
            res[p1[0]][p1[1]]=1;
            res[p2[0]][p2[1]]=4;
        }
        else if(res[p1[0]][p1[1]]==0&&res[p2[0]][p2[1]]==1){
            res[p1[0]][p1[1]]=4;
        }
        else if(res[p1[0]][p1[1]]==0&&res[p2[0]][p2[1]]==4){
            res[p1[0]][p1[1]]=1;
        }
        else if(res[p1[0]][p1[1]]==1&&res[p2[0]][p2[1]]==0){
            res[p2[0]][p2[1]]=4;
        }
        else if(res[p1[0]][p1[1]]==4&&res[p2[0]][p2[1]]==0){
            res[p2[0]][p2[1]]=1;
        }

        for(int p[]:list){
            int x=p[0],y=p[1];
            for(int pp[]:dir){
                int xx=x+pp[0];
                int yy=y+pp[1];
                dfs(A,xx,yy);
            }
        }
    }

}

/*
.......................
...XXXXX.XXX..XXXXXXX..
...X...X.X.X..X.....X..
.XXXXX.X.XXX..X.XXX.X..
.X.X.X.X......X.X.X.X..
.X.XXXXX..XXXXXXXXX.X..
.X...X....X...X.X...X..
.X.XXXXX..X.XXXXXXXXX..
.X.X.X.X..X.X.X.X......
.XXXXX.X..X.XXX.X.XX...
...X...X..X.....X.XXX..
...XXXXX..XXXXXXX..XXX.
........XX..........XX.
........XX.............
.X.X.X.X..XXXXX.XXXXX..
..X.X.X...X...X.X...X..
.X.X.X.X..X.XXXXXXX.X..
..X.X.X...X.X.X.X.X.X..
.X.X.X.X..XXXXX.XXXXX..
............x.....x....
* */

/*
.......X...X...........
.XXXXX.X.X.X.X.X.X.X...
.X...X.X...X..X...X.X..
.X.X.X.XXXXX...X...X...
.X...X......XX.........
* */


/*
.......................
...XXXXX.XXX..XXXXXXX..
...X...X.X.X..X.....X..
.XXXXX.X.XXX..X.XXX.X..
.X.X.X.X......X.X.X.X..
.X.XXXXX..XXXXXXXXX.X..
.X...X....X...X.X...X..
.X.XXXXX..X.XXXXXXXXX..
.X.X.X.X..X.X.X.X......
.XXXXX.X..X.XXX.X.XX...
...X...X..X.....X.XXX..
...XXXXX..XXXXXXX..XXX.
........XX..........XX.
........XX.............
.X.X.X.X..XXXXX.XXXXX..
..X.X.X...X...X.X...X..
.X.X.X.X..X.XXXXXXX.X..
..X.X.X...X.X.X.X.X.X..
.X.X.X.X..XXXXX.XXXXX..
..X.X.X.....X.....X....
* */