import java.util.*;
import java.io.*;

public class chess_ft implements Runnable {

	BufferedReader in;
	PrintWriter out;
	StringTokenizer st;

	private final static int MAXN = 300;
	private final static int MAXM = 300;

	private final static int WHITE = 0;
	private final static int BLACK = 1;
	private final static int GREY = 2;
	
	private String nextToken() throws IOException {
		while (!st.hasMoreTokens()) {
			st = new StringTokenizer(in.readLine());
		}
		return st.nextToken();
	}
	
	private int nextInt() throws NumberFormatException, IOException {
		return Integer.parseInt(nextToken());
	}
	
	private void myAssert(boolean e, String message) {
		if (!e) {
			throw new Error("Assertion failure!!! " + message);
		}
	}

	private void myAssert(boolean e) {
		myAssert(e, "");
	}

	int n;
	int m;
	int[][] f;
	char[][] answer;
	
	int myTrue = 0;
	
    private void solve() throws NumberFormatException, IOException {
    	n = nextInt();
    	myAssert(1 <= n && n <= MAXN, "n = " + n);
    	m = nextInt();
    	myAssert(1 <= m && m <= MAXM, "m = " + m);
    	f = new int[n][m];    	
    	for (int i = 0; i < n; i++) {
    		String s = nextToken();
    		myAssert(s.length() == m);
    		for (int j = 0; j < m; j++) {
    			char ch = s.charAt(j);
    			myAssert(ch == '*' || ch == '.' || ch == '?');
    			if (ch == '*') {
    				f[i][j] = BLACK;
    			} else if (ch == '.') {
    				f[i][j] = WHITE;
    			} else {
    				f[i][j] = GREY;
    			}
    		}
    	}
    	
    	createArrays();
    	
    	boolean ans = false;
    	for (int side = 1; side <= Math.max(m, n); side++) {
//    		System.out.println(side);
    		if (board(side)) {
    			ans = true;
    			break;
    		}
    	}
    	
    	if (ans) {
    		out.println("YES");
    		for (int i = 0; i < n; i++) {
    			for (int j = 0; j < m; j++) {
    				out.print(answer[i][j]);
    			}
    			out.println();
    		}
    	} else {
    		out.println("NO");
    	}
    	
	}
    
	private void createArrays() {
		int maxSide = Math.max(n, m);
    	canCell = new int[2][n + 2 * maxSide][m + 2 * maxSide];
		canRow = new int[2][n + 2 * maxSide][m + 2 * maxSide];
		ansBoard = new int[2][n + 2 * maxSide][m + 2 * maxSide];
		haveBoard = new int[2][n + 2 * maxSide][m + 2 * maxSide];
	}

	private boolean board(int side) {
		
		myTrue++;
		
		calcCanRow(side);
		calcCanCell(side);
		
		boolean res = false;
		
		outer:
		for (int i = -(side - 1); i <= 0; i++) {
			for (int j = -(side - 1); j <= 0; j++) {
				for (int color = 0; color < 2; color++) {
					if (canBoard(i, j, side, color) == myTrue) {
						res = true;
						paint(i, j, side, color);
						break outer;
					}
				}
			}
		}
		
		return res;
		
	}
	
	int[][][] canCell;
    private void calcCanCell(int side) {
    	for (int j = -(side - 1); j < m; j++) {
    		int top = -(side - 1);
    		int bottom = 0;
    		int cntWhite = side - 1;
    		int cntBlack = side - 1;
    		while (bottom < n + side - 1) {
    			if (canRow[WHITE][side + bottom][side + j] == myTrue) {
    				cntWhite++;
    			}
    			if (canRow[BLACK][side + bottom][side + j] == myTrue) {
    				cntBlack++;		
    			}

    			if (cntWhite == side) {
    				canCell[WHITE][side + top][side + j] = myTrue;
    			}
    			if (cntBlack == side) {
    				canCell[BLACK][side + top][side + j] = myTrue;
    			}
    			
    			if (canRow[WHITE][side + top][side + j] == myTrue) {
    				cntWhite--;
    			}
    			if (canRow[BLACK][side + top][side + j] == myTrue) {
    				cntBlack--;		
    			}
    			
    			top++;
    			bottom++;
    		}
    		
    	}
	}

	int[][][] canRow;
	private void calcCanRow(int side) {
		for (int i = -(side - 1); i < n + side - 1; i++) {
			int[] cnt = new int[3];
			int left = -(side - 1);
			cnt[2] = side - 1;
			int right = 0;
			while (right < m + side - 1) {
				int add = -1;
				if (right >= m || i >= n || i < 0) {
					add = 2;
				} else {
					add = f[i][right];
				}
				cnt[add]++;
				
				if (cnt[0] + cnt[2] == side) {
					canRow[0][side + i][side + left] = myTrue;
				} // else --- BUG
				if (cnt[1] + cnt[2] == side) {
					canRow[1][side + i][side + left] = myTrue;
				}
				
				int delete = -1;
				if (left < 0 || i >= n || i < 0) {
					delete = 2;
				} else {
					delete = f[i][left];
				}
				cnt[delete]--;
				
				left++;
				right++;
			}
		}
	}

	int cntBoard = 0;
	
	int[][][] ansBoard;
	int[][][] haveBoard;

	private int canBoard(int i, int j, int side, int color) {
		cntBoard++;
		if (i >= n || j >= m) {
			return myTrue;
		}
		if (haveBoard[color][side + i][side + j] == myTrue) {
			return ansBoard[color][side + i][side + j];
		}
		int res = myTrue;
		if (canCell[color][side + i][side + j] != myTrue) {
			res = 0;
		} else if (canBoard(i + side, j, side, 1 - color) != myTrue) {
			res = 0;
		} else if (canBoard(i, j + side, side, 1 - color) != myTrue) {
			res = 0;
		}

		haveBoard[color][side + i][side + j] = myTrue;
		ansBoard[color][side + i][side + j] = res;
		return res;
	}

	private void paint(int sr, int sc, int side, int color) {
		answer = new char[n][m];
		for (int i = sr; i < n; i += side) {
			for (int j = sc; j < m; j += side) {
				int curColor = (color + (i - sr) / side + (j - sc) / side) % 2;
				char ch = '.';
				if (curColor == 1) {
					ch = '*';
				}
				for (int k = i; k < i + side; k++) {
					for (int l = j; l < j + side; l++) {
						if (0 <= k && k < n && 0 <= l && l < m) {
							answer[k][l] = ch;
						}
					}
				}
			}
		}
	}

	public void run() {
		try {
			solve();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		} finally {
			out.close();
		}
	}

	public chess_ft(String taskName) {
		try {
			in = new BufferedReader(new FileReader(taskName + ".in"));
			out = new PrintWriter(new File(taskName + ".out"));
			st = new StringTokenizer(in.readLine());
		} catch (IOException ioe) {
			ioe.printStackTrace();
			System.exit(1);
		}
	}

	public static void main(String[] args) {
		(new Thread(new chess_ft("chess"))).start();
	}

}