#include using namespace std; int main(){ int H, W; cin >> H >> W; vector A(H); for(auto &&s:A)cin >> s; for(int my = 0; my <= H; my++){ for(int mx = -W; mx <= W; mx++){ if(my == 0 && mx == 0)continue; bool flag = true, dec = mx < 0; vector> used(H, vector(W)); for(int y = 0; y < H; y++){ for(int x = (dec ? W - 1 : 0); (dec ? x >= 0 : x < W - 1); (dec ? x-- : x++)){ if(used[y][x])continue; if(A[y][x] != '#')continue; if(y + my >= H || x + mx >= W || x + mx < 0){ flag = false; continue; } used[y][x] = true; if(A[y + my][x + mx] == '#'){ used[y + my][x + mx] = true; }else{ flag = false; } } } if(flag){ cout << "YES" << '\n'; return 0; } } } cout << "NO" << '\n'; }