#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 <= 50; my++){ for(int mx = 0; mx <= 50; mx++){ if(my == 0 && mx == 0)continue; bool flag = true; vector> used(H, vector(W)); for(int y = 0; y < H; y++){ for(int x = 0; x < W; x++){ if(used[y][x])continue; if(A[y][x] != '#')continue; if(y + my >= H || x + mx >= W){ 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'; }