#include #define PI 3.141592653589 #define ll long long using namespace std; template T_char ToUpper(T_char cX){return toupper(cX);} int main(){ int h, w; cin >> h >> w; char s[h][w]; bool ns[h][w]; for(int i=0; i> s[i]; for(int i=0; i=h || x+dx<0 || x+dx>=w){ flag = false; break; } if(s[y+dy][x+dx]=='#' && ns[y+dy][x+dx]==false){ ns[y+dy][x+dx] = true; flag = true; } else{ flag = false; break; } } } if(flag){ cout << "YES" << endl; return 0; } } cout << "NO" << endl; }