func_code_string: /* 2013-08-11 10:03:33.914034 */#include<iostream>   #include<cstdio>   #include<cstdlib>   #include<ctime>   #include<cmath>   #include<cctype>   #include<cstring>   #include<algorithm>      #include<map>   #include<set>   #include<vector>   #include<string>   #include<queue>      using namespace std;      char s[1011][1011];   bool u[1011][1011];   char c[1011][1011];   int n,m;   const int dx[]={1,0,-1,0};   const int dy[]={0,1,0,-1};   inline bool fitr(int x,int y){    return s[x][y+1]== b &&s[x][y+2]== w &&!u[x][y+1]&&!u[x][y+2];   }   inline bool fitc(int x,int y){    return s[x+1][y]== b &&s[x+2][y]== w &&!u[x+1][y]&&!u[x+2][y];   }   char choosec(int a,int b,int ax,int ay){    int opt=0;    for(int i=0;i<3;++i)    {     for(int k=0;k<4;++k)     {      int nx=a+dx[k],ny=b+dy[k];      if(nx>0&&nx<=n&&ny>0&&ny<=m)      {       if(c[nx][ny]!= . ) opt|=1<<(c[nx][ny]- a );      }     }     a+=ax,b+=ay;    }    for(int i=0;;++i)    {     if(((1<<i)&opt)==0) return i+ a ;    }   }   int main(){    scanf( %d%d ,&n,&m);    for(int i=1;i<=n;++i)    {     scanf( %s ,s[i]+1);     for(int j=1;j<=m;++j) c[i][j]= . ;    }    for(int i=1;i<=n;++i) for(int j=1;j<=m;++j) if(!u[i][j]&&s[i][j]!= . )    {     if(s[i][j]== b )     {      printf( NO n );      return 0;     }     else     {      if(fitr(i,j))      {       u[i][j]=u[i][j+1]=u[i][j+2]=1;       char co=choosec(i,j,0,1);       c[i][j]=c[i][j+1]=c[i][j+2]=co;      }      else      {       if(fitc(i,j))       {        u[i][j]=u[i+1][j]=u[i+2][j]=1;        char co=choosec(i,j,1,0);        c[i][j]=c[i+1][j]=c[i+2][j]=co;       }       else       {        printf( NO n );        return 0;       }      }     }    }    printf( YES n );    for(int i=1;i<=n;++i) printf( %s n ,c[i]+1);    return 0;   }   