#include using namespace std; #define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i istream &operator>>(istream &is, vector &vec) { for (auto &v : vec) is >> v; return is; } int main() { int H, W; cin >> H >> W; vector S(H); cin >> S; REP(dx, H) for (int dy = -W + 1; dy < W; dy++) if (dx or dy) { auto T = S; bool f = true; REP(i, H) REP(j, W) if (T[i][j] == '#') { if (i + dx >= H or j + dy >= W or j + dy < 0 or T[i + dx][j + dy] == '.') f = false; else T[i + dx][j + dy] = '.'; } if (f) { puts("YES"); return 0; } } puts("NO"); }