#include #include #include using namespace std; #define RREP(i,s,e) for (int i = e-1; i >= s; i--) #define rrep(i,n) RREP(i,0,n) #define REP(i,s,e) for (int i = s; i < e; i++) #define rep(i,n) REP(i,0,n) bool search(vector& s) { int h = s.size(); int w = s[0].size(); int found; bool ret = false; rep (di,h) rep (dj,w) { found = -1; vector b = s; if (di == 0 && dj == 0) continue; rep (i,h) rep (j,w) { if (b[i][j] == '#') { if (i+di < h && j+dj < w && b[i+di][j+dj] == '#') { b[i+di][j+dj] = '.'; found *= found; } else found = 0; } } ret |= found == 1; } return ret; } int main() { int h, w; cin >> h >> w; vector s; s.resize(h); rep (i,h) cin >> s[i]; bool ans = search(s); rep (i,h) reverse(s[i].begin(),s[i].end()); ans |= search(s); if (ans) cout << "YES" << endl; else cout << "NO" << endl; return 0; }