#include using namespace std; #ifdef LOCAL_DEBUG #include "LOCAL_DEBUG.hpp" #endif #define int long long template vector make_vec(size_t a) { return vector(a); } template auto make_vec(size_t a, Ts... ts) { return vector(ts...))>(a, make_vec(ts...)); } template typename enable_if::value == 0>::type fill(T &t, const V &v) { t = v; } template typename enable_if::value != 0>::type fill(T &t, const V &v){ for (auto &e : t) fill(e, v); } // auto v = make_vec(h, w); // fill(v, 0); signed main(){ int h, w; cin >> h >> w; vector s(h); for(int i = 0; i < h; i++){ cin >> s[i]; } for(int i = 0; i < h; i++){ for(int j = 0; j < w; j++){ if(i == 0 && j == 0) continue; auto v = make_vec(h, w); fill(v, 0); auto visited = make_vec(h, w); fill(visited, 0); bool judge = true; for(int k = 0; k < h; k++){ for(int l = 0; l < w; l++){ if(visited[k][l]) continue; if(s[k][l] == '#'){ if(visited[k][l]) continue; if(k + i >= h || l + j >= w || s[k + i][l + j] == '.'){ judge = false; }else{ visited[k + i][l + j] = 1; } } } } if(judge){ cout << "YES" << endl; return 0; } } } cout << "NO" << endl; return 0; }