#include #include #include #include #include #include #include #include #include #include #include using ll = long long; using namespace std; int main(){ int h, w; cin >> h >> w; string s; vector v(h); for (int i = 0; i < h; i++) cin >> v[i]; for (int i = 0; i < h; i++){ for (int j = -w + 1; j < w; j++){ int dy = i, dx = j; bool no = false, yes = false; vector tmp = v; if (dy == 0 && dx == 0) continue; for (int k = 0; k < h; k++){ for (int l = 0; l < w; l++){ if (tmp[k][l] == '#'){ tmp[k][l] = 'R'; if (k + dy >= 0 && k + dy < h && l + dx >= 0 && l + dx < w){ if(v[k+dy][l+dx] == '#'){ tmp[k+dy][l+dx] = 'B'; yes = true; } else { no = true; yes = false; break; } } else { no = true; yes = false; break; } } } if (no) break; } if (yes){ cout << "YES" << endl; return 0; } } } cout << "NO" << endl; }