#include using namespace std; template void fin(T a){ cout<>h>>w; vector s(h),t(h); for(int i=0;i>s[i]; bool f=false; for(int i=0;i=w||i+D>=h)ok=0; else if(t[i+D][j+R]!='#')ok=0; else t[i+D][j+R]='.'; } } } if(ok)fin("YES"); } } for(int i=0;i=w||i+D>=h)ok=0; else if(t[i+D][j+R]!='#')ok=0; else t[i+D][j+R]='.'; } } } if(ok)fin("YES"); } } fin("NO"); }