{$apptype console}
//{$o-,r+,q+}
{$o+,r-,q-}
{$maxstacksize 30000000}
uses
  sysutils, math;

type
  int = longint;

const
  maxn = 250;
  maxm = 250;
  black = 0;
  white = 1;
  grey = 2;

var
  f : array[-maxn..2 * maxn, -maxn..2 * maxn] of int;
  maxSq : array[-maxn..2 * maxn, -maxn..2* maxn, 0..1] of int;
  n, m : int;
  answer : array[0..maxn - 1, 0..maxm - 1] of char;

procedure paint(sr, sc, color, side : int);
var
  i, j : int;
  k, l : int;
  curColor : int;
  ch : char;
begin
  i := sr;
  while (i < n) do
  begin
    j := sc;
    while (j < m) do
    begin
      curColor := (color + (i - sr) div side + (j - sc) div side) mod 2;
      if (curColor = BLACK) then ch := '*';
      if (curColor = WHITE) then ch := '.';
      for k := 0 to side - 1 do
      begin
        for l := 0 to side - 1 do
        begin
          if (0 <= i + k) and (i + k < n) and (0 <= j + l) and (j + l < m) then
            answer[i + k][j + l] := ch;    
        end;
      end;
      inc(j, side);
    end;
    inc(i, side);
  end;
end;

var
  haveBoard : array[-maxn..2 * maxn, -maxn..2 * maxn, 0..1] of boolean;
  ansBoard : array[-maxn..2 * maxn, -maxn..2 * maxn, 0..1] of boolean;

function canBoard(i, j, color, side : int) : boolean;
begin
  if (i >= n) or (j >= m) then
  begin
    result := true;
    exit;
  end;
  if (haveBoard[i][j][color]) then
  begin
    result := ansBoard[i][j][color];
    exit;
  end;
  result := (maxSq[i][j][color] >= side) and
            (canBoard(i + side, j, 1 - color, side)) and
            (canBoard(i, j + side, 1 - color, side));
  ansBoard[i][j][color] := result;
  haveBoard[i][j][color] := true; 
end;

function board(side : int) : boolean;
var
  i, j, k : int;
begin
  fillchar(ansBoard, sizeof(ansBoard), false);
  fillchar(haveBoard, sizeof(haveBoard), false);
  result := false;
  for i := -(side - 1) to 0 do
  begin
    if (result) then break;
    for j := -(side - 1) to 0 do
    begin
      if (result) then break;
      for k := 0 to 1 do
      begin
        if (canBoard(i, j, k, side)) then
        begin
          result := true;
          paint(i, j, k, side);
          break;
        end;
      end;  
    end;
  end;  
end;

var
  i, j, k : int;
  side : int;
  ch : char;
  maxSide : int;
  ans : boolean;
  tmp : int;
  str : string;

begin
  reset(input, 'chess.in');
  rewrite(output, 'chess.out');

  readln(n, m);
  assert((1 <= n) and (n <= maxn));
  assert((1 <= m) and (m <= maxm));
  
  for i := -maxn to 2 * maxn do
  begin
    for j := -maxn to 2 * maxn do
    begin
      f[i][j] := grey;
    end;
  end;

  for i := 0 to n - 1 do
  begin
     readln(str);
     for j := 0 to m - 1 do
     begin
       ch := str[j + 1];
       assert(ch in ['*', '.', '?']);
       if (ch = '*') then f[i][j] := black;
       if (ch = '.') then f[i][j] := white;
       if (ch = '?') then f[i][j] := grey;
     end;
  end;

  for i := 2 * maxn downto -maxn do
  begin
    for j := 2 * maxn downto -maxn do
    begin
      maxSq[i][j][0] := 1;
      maxSq[i][j][1] := 1;
    end;
  end;
  for i := 2 * maxn - 1 downto -maxn do
  begin
    for j := 2 * maxn - 1 downto -maxn do
    begin
      for k := 0 to 1 do
      begin
        if (f[i][j] = 1 - k) then
        begin
          maxSq[i][j][k] := 0;
        end else begin
          tmp := 1000000000;
          if (i + 1 <= 2 * maxn) then tmp := min(tmp, maxSq[i + 1][j][k]);
          if (j + 1 <= 2 * maxn) then tmp := min(tmp, maxSq[i][j + 1][k]);
          if (i + 1 <= 2 * maxn) and (j + 1 <= 2 * maxn) then tmp := min(tmp, maxSq[i + 1][j + 1][k]);
          maxSq[i][j][k] := tmp + 1; 
        end;
      end;
    end;
  end;

  maxSide := max(n, m);
  ans := false;

  for side := 1 to maxSide do
  begin
    if (board(side)) then
    begin
      ans := true;
      break;
    end;  
  end;

  if (ans) then
  begin
    writeln('YES');
    for i := 0 to n - 1 do
    begin
      for j := 0 to m - 1 do
      begin
        write(answer[i][j]);
      end;
      writeln;
    end;
  end else begin
    writeln('NO');
  end;

end.