#include using namespace std; int main() { int h,w,n=0; cin>>h>>w; vector s(h); for(int i=0; i>s[i]; for(int j=0; j> vst(h,vector(w)); int pnt=0; for(int i=0; i=h || yy<0 || yy>=w){ continue; } if(s[i][j]=='#' && s[xx][yy]=='#' && !vst[i][j] && !vst[xx][yy]){ vst[i][j]=vst[xx][yy]=1; pnt+=2; } } } if(pnt==n && pnt>0){ cout<<"YES"<