// competitive-verifier: PROBLEM https://yukicoder.me/problems/no/0179 #include #include #include int main(void) { int h, w; std::cin >> h >> w; std::vector b(h); for (auto &s : b) std::cin >> s; bool ans = false; for (int i = 0; i < h; ++i) { for (int j = 0; j < w; ++j) { if (i == 0 && j == 0) continue; bool f = true; std::vector dp(h, std::vector(w, -1)); for (int x = 0; x < h; ++x) { for (int y = 0; y < w; ++y) { if (b[x][y] == '#') { if (dp[x][y] == 1) continue; if (i + x < h && j + y < w && b[i + x][j + y] == '#') dp[i + x][j + y] = 1; else f = false; } } } ans |= f; } } std::cout << (ans ? "YES\n" : "NO\n"); return 0; }